题海让大学四年没有难题
白天模式登陆

题目详情

单选题 Analyze the following program fragment: int x; double d = 1.5; switch (d) { case 1.0: x = 1; case 1.5: x = 2; case 2.0: x = 3; }

A. The program has a compile error because the required break statement is missing in the switch statement

B. The program has a compile error because the required default case is missing in the switch statement

C. The switch control variable cannot be double

D. No errors

Java程序设计-非计算机课程封面

学科:Java程序设计-非计算机

时间:2023-06-18 05:09:11

Copyright © 2022 津ICP备2021001502号