Hello all, I am new to the community so sorry if I don't post the correct way. Will do the best that I can.
Here is my code.I am using a IDE (eclipse) and it doesn't show me any errors. But every time I try to run it in CMD but I get a error saying "cannot find symbol class in = new Scanner" Any help would be much appreciated!
public class HelloApp { public static void main(String [] args) { Scanner in = new Scanner( System.in); int number1; int number2; int sum; System.out.println("Hello!"); System.out.println("Welcome to my first java calculator!"); System.out.println("When you are ready, Input your first number!"); number1 = input.nextInt(); // User inputs first number System.out.println("Okay, Now the second number please!"); number2 = input.nextInt(); // User inputs second number sum = number1 + number2; System.out.printf ("Sum is %d\n", sum); } }
Very basic program so I doubt that anyones brain will be hurt over this, I am jsut so new that every key is confusing.