Hi im new to java and i just started my summer homework with jcreator. Well my teacher told us to do this code and i tried it on my friends computer and it worked fine.Well now im at home and every time i try to run the program I get "Cannot resolve symbol class Scanner"
Does any one know how to fix this
Thanks

import java.util.Scanner;
public class lab3
{
public static void main (String args[])
{
Scanner in = new Scanner(System.in);
 
long x;
long y;
 
System.out.println("please enter a positive whole number below 1000 ");
x=in.nextLong();
 
y=x;
x=x+3;
x=x*2;
x=x-4;
x=x/2;
x=x-y;
 
System.out.println("Your number is "+x+" and your original number is "+y); 
 
 
 
 
}
}
Member Avatar for iamthwee

You need to use the latest java development kit for the scanner utility class.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.