- Collection Framework in JavaCollections Class in JavaList Interface in Java with ExamplesArrayList in JavaVector Class in JavaLinkedList in JavaQueue Interface In JavaPriorityQueue in JavaSet in JavaHashSet in JavaLinkedHashSet in JavaMap in the JavaHashMap in JavaHashtable in JavaLinkedHashMap in Java
if…else Statement
An if proclamation can be trailed by a non-compulsory else explanation, which executes when the Boolean outflow is false. The syntax for this construct is as follows:
if(<condition>){
//Executes if condition is true
}
else{
//Executes if condition is false
}
Sample Implementation:
public class myTest {
public static void main(string args[]) {
int i = 0;
if (i > 1) {
System.out.print(“The
if construct is executing!”);
} else {
System.out.print(“The
else construct is executing!”);
}
}
}
This would create the accompanying result:
The else construct is executing!