首页 试题广场 > 试题详情
单选题

【C011002】What is the result of compiling and executing the following fragment of code:

Boolean flag = false;
if (flag = true)
{
System.out.println(“true”);
}
else
{
System.out.println(“false”);
}

  • A.The code fails to compile at the “if” statement.
  • B.An exception is thrown at run-time at the “if” statement.
  • C.The text“true” is displayed.
  • D.The text“false”is displayed.
  • E.Nothing is displayed.
提交并查看答案
下一题 上一题
Ke星伙伴们的回答/ 29个回答
关闭
关闭
QQ
交流群
邀请
好友
App
下载
意见
反馈
返回
顶部