Switch to full style
Java2 codes,problems ,discussions and solutions are here
Post a reply

JOptions and If - Else statement

Thu Oct 30, 2008 9:54 pm

Am new to Java and and am having a problem making a program using and
If-Else statements.Anyone who has a golden heart to give a sample or
any good site with Java examples?



Re: JOptions and If - Else statement

Thu Oct 30, 2008 9:56 pm

Code:
String s = "Hello World";
int conditions = 1;
if(conditions == 1){
System.out.println(s);
} else if(conditions ==2) {
System.out.println("something else");
} else {
// ... do something else
}


Post a reply
  Related Posts  to : JOptions and If - Else statement
 difference between break statement and a continue statement     -  
 difference between a while statement and a do statement     -  
 while Statement in php     -  
 The do...while Statement     -  
 Using the for Statement     -  
 PHP if statement and else if     -  
 Need help with if statement     -  
 Using the continue Statement     -  
 Define statement     -  
 For statement without all three statements     -