我应该用什么将stdin更改为



我需要帮助。我还是Java的初学者,所以我的知识还很薄弱。

我做了很多尝试,但我仍然不知道为什么我的编程构建失败了。你们能帮我吗?

package act2i;
import java.io.*;
public class Act2I {

public static void main(String[] args) throws IOException {
BufferedReader inData = new BufferedReader (new
InputStreamReader(System.in));

//declare variable
String str;

System.out.println("Enter the data: ");
str = stdin.readLine();//read input that is entered by user

//display an output, str value
System.out.println("You have entered: " + str);
}//end main()
}//end class

您应该更改"stdin";至";inData";。

最新更新