Hello Everyone, I am facing an error while executing the below program. Can anyone help me out?
I keep getting this ^^ error when trying to compile the following code on Interviewbit. I'm new to Java and I can't find a solution online, sorry if the solution is really obvious:
Any Suggestions?
Java:
EyeColour.java:27: error: cannot find symbol
Scanner input = scanner(System.in);
^
symbol: method scanner(InputStream)
location: class EyeColour
1 error
I keep getting this ^^ error when trying to compile the following code on Interviewbit. I'm new to Java and I can't find a solution online, sorry if the solution is really obvious:
Java:
import java.util.Scanner;
class EyeColour //
{
public static void main (String[] param)
{
InputEye();
System.exit(0);
} // END main
public static void InputEye()
{
Scanner scanner = Scanner(System.in);
System.out.println("What is your eye colour?");
String EyeColour;
EyeColour = scanner.nextLine();
System.out.println("So your eyes are " + EyeColour + " are they? I like " + EyeColour);
return;
} // END InputEye
} // END class EyeColour
Any Suggestions?
Dislike ads? Remove them and support the forum:
Subscribe to Fastlane Insiders.