- 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
do…while Loop
A do…while loop is similar to the while looping construct aside from that a do…while circle is ensured to execute no less than one time. The syntax for this looping construct is as follows:
do {//Statements }while(<booleanexpression>);
Perceive that the Boolean declaration shows up toward the end of the circle, so the code execute once before the Boolean is tried. In the event that the Boolean declaration is genuine, the stream of control bounced go down to do, and the code execute once more. This methodology rehashes until the Boolean articulation is false.
Sample implementation:
public class myTest {
public static void main(string args[]) {
int i = 1;
do {
System.out.print(“i = ”+i);
i++;
System.out.print(“\n”);
} while (i < 1);
}
}
This would create the accompanying result:
i = 1