题目详情
单选题 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程序设计-非计算机
时间:2023-06-18 05:09:11
相关题目
相关作业
