New to Java. Following exercise #1 of a Java book.
Code is the following:
import java.util.*;
public class FirstProject
{
public static void main(String[] args)
{
System.out.println("Hello out there.");
System.out.println("I will add two numbers for you.");
System.out.println("Enter two whole numbers on a line:");
int n1, n2;
Scanner keyboard = new Scanner(System.in);
n1 = keyboard.nextInt( );
n2 = keyboard.nextInt( );
System.out.println("The sum of those two numbers is");
System.out.println(n1 + n2);
}
}
Error is:
Scanner cannot be resolved or is not a type
The import java.util is never used
Today I went to the following link:
and downloaded jdk-1_5_0_06-windows-i586-p-iftw.exe
I installed it but I am still getting the same error.
What do I need to do to solve the problem?
Thank you,
En..
Code is the following:
import java.util.*;
public class FirstProject
{
public static void main(String[] args)
{
System.out.println("Hello out there.");
System.out.println("I will add two numbers for you.");
System.out.println("Enter two whole numbers on a line:");
int n1, n2;
Scanner keyboard = new Scanner(System.in);
n1 = keyboard.nextInt( );
n2 = keyboard.nextInt( );
System.out.println("The sum of those two numbers is");
System.out.println(n1 + n2);
}
}
Error is:
Scanner cannot be resolved or is not a type
The import java.util is never used
Today I went to the following link:
and downloaded jdk-1_5_0_06-windows-i586-p-iftw.exe
I installed it but I am still getting the same error.
What do I need to do to solve the problem?
Thank you,
En..