Actually, I'm having some trouble now, if there's anyone out there who can help.
The above was working for me what I was using very very simple java programs (I'm just starting to learn, so it was working for the first lesson).
So, when I had my main class with only a method that prints stuff, it was working.
But now I'm trying something a bit more complicated, and it's not working. And I know it should be working, because it's working from cmd (I'm using win7 64 bit in case that's important)
Here's the code:
public class Addition
public static void main( String] args)
Scanner input = new Scanner( System.in );
System.out.print("Adding numbers --");
System.out.print("Enter first integer: ");
number1 = input.nextInt();
System.out.print("Enter second integer: ");
number2 = input.nextInt();
sum = number1 + number2;
System.out.printf( "Sum is %d\n", sum );
And here is the error message when I press f7:
Adding numbers --
Enter first integer: Exception in thread "main" java.util.NoSuchElementException
[Finished in 1.1s with exit code 1]
So, looks like it's having trouble with importing Scanner input or something...dunno.
Anybody have an idea of what's going on and how to fix it?
For the record, it's apparently building it correctly, just not running it correctly.