正在加载图片...
Syntax for the switch statement itch <arithmetic expression>)I <case label 1>: <case body 1> <case label n>: <case body n> Arithmetic Expression 。垂鲁0。。。 gradelevel.)t …·…······ case 1: outputBox printline("Go to the Gymnasium")i Case breaki Label case 2: outputBox printLine("Go to the Science Auditorium")i breaki ∴……………………………………… e case 3:outputBox printLine("Go to Harris Hall Rm A3 )i. Case Bod case 4: outputBox printline("Go to Bolt Hall Rm 101 )i break C 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 6-25© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 6 - 25 Syntax for the switch Statement switch ( gradeLevel ) { case 1: outputBox.printLine("Go to the Gymnasium"); break; case 2: outputBox.printLine("Go to the Science Auditorium"); break; case 3: outputBox.printLine("Go to Harris Hall Rm A3"); break; case 4: outputBox.printLine("Go to Bolt Hall Rm 101"); break; } switch ( <arithmetic expression> ) { <case label 1> : <case body 1> … <case label n> : <case body n> } Case Body Arithmetic Expression Case Label
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有