Hi,
i will try to help you out a bit
The method "public static void main(String[] args)" is basically only needed as entry point for standard java programs, if your applet is run from a browser you wont need that function.
And about the if,i would better write it in a way like
if ((answer.equalsIgnoreCase("y") || (answer.equalsIgnoreCase("yes")) {
....
this ensures String comparison is used, and if the user types Y or YES it will be also valid.