The syntax format of a witch statement is Switch (case value) {Case 1: Operation 1; break; Case 2: Operation 2; break; Case 3: Operation 3; break; case 4: Operation 4; break ;.................. Package com. ibm. four; publicclass SwitchDemo {// Switch statement of the second type of branch statement // syntax format/******* // public static void main (String [] args) {// int a = 0; // switch (a) {// case 1: System. out. println ("1"); break; // case 2: System. out. println ("2"); break; // case 3: System. out. println ("3"); break; // case 4: System. out. println ("4"); break; // case 5: System. out. println ("5"); break; // case 6: System. out. println ("6"); break; // Case 7: System. out. println ("7"); break; // case 8: System. out. println ("8"); break; // case 9: System. out. println ("9"); break; // case 10: System. out. println ("10"); break; // default: System. out. println ("0"); break; //} For Loop used For repeated operations! For (int I = initial value; I <maximum range; increase in each loop) {// The operation done once in a loop} package com. ibm. four; public class ForDemo {// output the 10 public static void main (String [] args) {for (int I = 1; I <= 10; I ++) {System. out. println (I);} // output 1 + 2 + 3 + 4 +... + 100 // 0 + 1 = 1 // 1 + 2 = 3 // 3 + 3 = 6 // 6 + 4 = 10 int sum = 0; // result value for (int I = 1; I <= 100; I ++) {sum = sum + I;} System. out. println (sum ); // output multiplication formula/* 1*1 = 1*1*2 = 2 2*2 = 4*1*3 = 3 2*3 = 6 3*3 = 9 *. *. *. *. * 1*8 = 8 2*8 = 16 3*8 = 24 4*8 = 32 5*8 = 40 6*8 = 48 7*8 = 56 8*8 = 64*1*9 = 9 2*9 = 18 3*9 = 27 4*9 = 36 5*9 = 45 6*9 = 54 7*9 = 63 8*9 = 72 9*9 = 81 **/for (int I = 1; I <= 9; I ++) {for (int j = 1; j <= I; j ++) {System. out. print (j + "*" + I + "=" + j * I + "\ t");} System. out. println () ;}} While LOOP syntax format While (condition) {// The operation executed cyclically} package com. ibm. four; public class WhileDemo {public static void main (String [] args) {// 1 uses the while loop to output 1-10 int I = 1; while (I <= 10) {System. out. println (I); I ++;} // output 10-1 int j = 10; while (j> = 1) {System. out. println (j); j = J-1;} // output 1-100 and int k = 1; int sum = 0; while (k <= 100) {sum = sum + k; k ++;} System. out. println (sum); // if the condition in the while loop is invariably set, then the while loop is an endless loop while (true) {System. out. println ("-------------------------------------------");} // only one dead loop exists in a method.} action in the Dowhile loop Do {// action in the loop body} while (condition) use dowhile to output 1 to 10