Program keeps crashing!
Im doing this code and it keeps on saying that "a fatal exception has occurred: program will now exit" whenever I try to run it. It compiles fine it just keeps on crashing... Any help would be much appreciated.
java.lang.NoSuchMethodError: main
Exception in thread "main"
is what i also receive after it crashes...
[341 byte] By [
nvaughna] at [2007-11-27 7:03:44]

import java.util.*;
public class HardCodedPass_basic
{
public int verify(String password)
{
if (password.equals("open"))
return 0;
else
return 1;
}
public void main (String[] args)
{
System.out.print("What is your name? ");
Scanner scan = new Scanner(System.in);
String name = scan.next();
if (name == "Nate")
{
System.out.print("Hello, " + name +"! How good of you to be here!\n");
}
else
{
System.out.print("Hello, "+ name+ "!\n");
System.out.print("What is the secret word? ");
String guess = scan.next();
while(verify(guess) != 0)
{
System.out.print("Wrong, try again. What is the secret word? ");
guess = scan.next();
}
}
System.out.print("Good job $name. A few more wrong guesses and I " +
"would've had to call the cops...\n");
}
}