View Single Post
  #2 (permalink)  
Old 09-02-2010, 01:50 AM
Zhdophanti Zhdophanti is offline
Junior Member
 

Join Date: Feb 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Zhdophanti is on a distinguished road
Default Re: If-Else Statement help

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.
Reply With Quote