本文介绍了评估未成功,因为线程未挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用户!我的Microsoft VS代码有问题.当我使用

users!I have a problem with my Microsoft VS Code.When i run my code with method

System.in.read()

我有一个问题由于线程未挂起,评估失败."

i have a problem "Evaluation failed because the thread is not suspended."

P.S.当我使用javac和java运行文件时,此代码有效.

P.S. When i run file using javac and java this code is work.

我对VS Code也有问题另一个问题

i also have problem with VS Code another problem

我的代码

import java.io.IOException;

public class example {
    public static void main(String args[])
    throws IOException {
        char symbol;
        int count = 0, count_space = 0;
        do {
            symbol = (char) System.in.read();
            if (symbol == ' ') {
                count_space += 1;
            }
            count += 1;
        } while(symbol != '.');
        System.out.println("Всего символов: " + count);
        System.out.println("Из них пробелов: " + count_space);
     }
}

对不起,语法错误.你能帮我吗?

Sorry for bad grammar.Can you help me?

推荐答案

我是一名中国学生,遇到同样的问题.我在百度找到了解决方案.

I'm a chinese student and i had the same problem. I found a solution in baidu.

vscode的内置调试控制台不支持Java输入.因此,您需要在调试配置文件(launch.json)中修改调试控制台,只需将控制台属性从"internalConsole"修改为"integratedTerminal"或"externalTerminal".

The built-in debugging console of vscode does not support java input. So you need to modify the debug console in the debug configuration file (launch.json), just modify the console property from "internalConsole" to "integratedTerminal" or "externalTerminal".

这篇关于评估未成功,因为线程未挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 04:35
查看更多