+ 5
hello guys this java code seems not to be working on netbeans and eclipes IDE .
import java.util.Scanner; class MyClass { public static void main(String[] args) { Scanner myVar = new Scanner(System.in); System.out.println(myVar.nextLine()); } } The Program wont even run guys please i need your help on this
8 ответов
+ 30
it compiles on my side. Please show the error what you have
+ 19
u can use "text fields" or "text boxes" & many more components to take user input
//in IDE's (netbeans)
+ 8
What is the error? Did you install the JDK on your system?
+ 6
That's because it is waiting for user input. Notice the blinking caret (a.k.a. cursor) in the console window?
+ 3
but however other code runs fine
+ 2
thats the problem it shows no error , when i type the code and click run it just keep running but it shows no output nor errors and when i click stop it says
BUILD STOPPED (total time: 16 minutes 46 seconds)
0
You are trying to print a string from the user, so while running you need to enter a text then hit enter. The program should print it out.
0
Perhaps you don't have the JDK installed?
My favorite IDE is BlueJay, I tend to have fewer issues on the runtime side with it than other IDE's.