My Java source code keeps getting errors regarding utility s
My Java source code keeps getting errors regarding utility scanner. Tutorials suggest I use the Java utility, but am unable to locate it. Please advise how to resolve. Thank you.
import java.util.Scanner; -- Error message: illegal start of type <identifier expected>
// Create a scanner class object
Scanner input = new Scanner(System.in); -- Error message: Cannot find symbol classScanner
Solution
You are getting the following errors while importing the Scanner class because the JDK version which you might be using to build and execute your project is not 5 or above.
java.util.Scanner is available since JDK 5.
Select a new platform of JDK 5 or above in project properties of your project so as to avoid these error messages.
