Posts

Showing posts with the label loops

Conditions and Loop

Image
 Conditions..... Java has 3 types of conditional statements. If else else if If a specified condition is true, we use "if" to execute a code block  under it. If the same condition is false, we use "else" to specify a block of code to be executed. And then we can use "else if" to specify a new condition to test if the 1st condition is false. The above conditions return only boolean values.(true/false) eg :- class A{             if(true){                sout ("A"); }             else {                sout ("B"); }          } eg :- class A{             if(false){                sout ("A"); }             else if{                sout ("B"); }           ...