Hello.
I am using Netbeans 4.0 Beta 2 with JDK 1.5. With this simple, short code I am generating an error that I can't seem to figure out.
It builds fine, however when I run the program it generates this error message.Code:import java.util.*; public class Main { public static void main (String [] args) { Scanner input = new Scanner(System.in); String myName = input.next(); System.out.println(myName); } }
Has anyone encountered this. I have reinstalled Netbeans and the JDK several times, but it still doesn't work.Code:Exception in thread "main" java.util.NoSuchElementException at java.util.Scanner.throwFor(Scanner.java:817) at java.util.Scanner.next(Scanner.java:1317) at Main.main(Main.java:8) Java Result: 1
Thanks for any help.
Pete




Reply With Quote