Package com. xml. test;
Public class Testc {
/**
* If else/if else if difference
* If (){
* If the condition is true, the execution is performed.
*} Else (){
* If the condition is not true, run this command.
*}
*------------------------------------------------------------------------------
* If (){
* If the condition is true, the execution is performed.
*} Else if (){
* If the if statement is not true, the else statement is executed if it is true.
*} Else if (){
* If the preceding else is not true, the first else if is executed. if the else if condition is true, the next else if statement is not executed.
*} Else {
* If none of the above if or else if conditions are true, the last else block is executed.
*}
*/
Public static void main (String [] args ){
Int a = 100;
If (a & gt; 1000 ){
System. out. println ("Great, I can buy Audi Q7 ");
} Else if (a> 500 ){
System. out. println ("oh, I can buy Audi Volvo cx90 ");
} Else if (a> 95 ){
System. out. println ("not bad, I also like ");
} Else if (a> 90 ){
System. out. println (" ");
} Else {
System. out. println ("implement the house first ");
}
CircleControler ();
System. out. println ("I am back to main ...........");
}
/**
* Difference between break return and continue fs
* The break force interrupts the cycle, and the judgment statements after the break in the loop body are not judged, directly jumping out of the loop in Vitro
* When break is used in a series of nested loops, it will only terminate the innermost loop.
*
* When the continue statement is executed, the loop will skip the next part and return directly to the starting point of the loop for judgment and operation (a <10; a ++)
*
* When the return statement is executed, all nested loops in the method are skipped and the place where the method is called is directly redirected to continue execution.
**/
Public static void circleControler (){
For (int I = 0; I <2; I ++ ){
For (int a = 0; a <10; a ++ ){
System. out. println ("starts ......" + );
If (a = 5 ){
Return;
}
}
System. out. println ("jumping out of the For small loop .............");
}
System. out. println ("jumping out of the For loop .............");
}
}