Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Java Programming/Keywords/case

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

is a Java keyword. This is part of the statement, to find if the value passed to the switch statement matches a value followed by case. For example: int i = 3; switch(i) { case 1: System.out.println("The number is 1."); break; case 2: System.out.println("The number is 2."); break; case 3: System.out.println("The number is 3."); // this line will print break; case 4: System.out.println("The number is 4."); break; case 5: System.out.println("The number is 5."); break; default: System.out.println("The number is not 1, 2, 3, 4, or 5."); } deep