经典指数          
原因
1653
浏览数
0
收藏数
 

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”);
}

  • The code fails to compile at the “if” statement.
  • An exception is thrown at run-time at the “if” statement.
  • The text“true” is displayed.
  • The text“false”is displayed.
  • Nothing is displayed.

     举报   纠错  
 
切换
暂时还没有答案,欢迎分享你的解答 . . .
撰写答案
扫描后移动端查看本题