so I was working on a program for school in Java and I am using Eclipse on mac osx. When I run the program it gives me this error:
Exception in thread "main" java.util.InputMismatchException
at java.util.Scanner.throwFor(Scanner.java:864)
at java.util.Scanner.next(Scanner.java:1485)
at java.util.Scanner.nextInt(Scanner.java:2117)
at java.util.Scanner.nextInt(Scanner.java:2076)
at Dank.main(Dank.java:13)
This is the code:
import java.util.Scanner;
public class Dank
{
static Scanner in = new Scanner(System.in);
public static void main(String args[])
{
int antonio='0';
int answer;
System.out.print("Whats your name? ");
answer = in.nextInt();
if (answer == antonio) {
System.out.println("are you sure? you are a Dank Meme "+answer);
}
else
{
System.out.println("Damn, you aren't a Dank Meme "+answer);
}
}
}