Chapter4_2-DecisionStatements

Yes execute statement1 the then clause execute

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: sion is true ? Yes execute Statement1 //the then clause execute Statement2 //the else clause execute Next-Statement Page 8 Dr. S. GANNOUNI & Dr. A. TOUIR Introduction to OOP Switch Statement switch ( <arithmetic expression> ) { <case label 1> : <case body 1> … <case label n> : <case body n> } Arithmetic Expression Arithmetic Expression switch ( coutryCode ){ case 1: System.out.print(“Assalamo Alaikom"); break; Case Case Label Label case 2: System.out.print(“Hello"); break; case 3: System.out.print(“Bojour"); break; Case Case Body Body case 4: System.out.print(“Bonas Dies"); break; } Page 9 Dr. S. GANNOUNI & Dr. A. T...
View Full Document

This document was uploaded on 03/03/2014.

Ask a homework question - tutors are online