Hi everyone,
i wrote this piece of code on windows using Eclipse ad it compiled and ran fine:
, i tried to compile and run this code on my mac, it compiled fine but i cant get it to work, the terminal shows this message:
I hope someone can help.
TIA
i wrote this piece of code on windows using Eclipse ad it compiled and ran fine:
import java.util.Scanner;
public class AgendaTest {
public static void main(String[] args) {
Scanner in = new Scanner (System.in);
boolean done = false;
System.out.println ("Defina o tamanho da agenda:");
int tamanho = in.nextInt();
}
}
, i tried to compile and run this code on my mac, it compiled fine but i cant get it to work, the terminal shows this message:
Defina o tamanho da agenda:
Exception in thread "main" java.util.NoSuchElementException
at java.util.Scanner.throwFor(Scanner.java:817)
at java.util.Scanner.next(Scanner.java:1431)
at java.util.Scanner.nextInt(Scanner.java:2040)
at java.util.Scanner.nextInt(Scanner.java:2000)
at AgendaTest.main(AgendaTest.java:12)
Program exited with status 1.
I hope someone can help.
TIA