Is the following code snippet legal?
Boolean b = false;
Do
{
System.out.println("Do you think in Java?") ;
}
While (b != b) ;
A) Yes, it is legal but does not print anything.
B) Yes, it is legal and prints "Do you think in Java?" once.
C) Yes, it is legal and prints "Do you think in Java?" twice.
D) No, it is not legal and gives a compilation error.
Correct Answer:
Verified
Q27: What is the output of the code
Q45: Which statement about this code snippet is
Q62: How many times is the text "Let's
Q71: How many times does the following loop
Q85: Which statement is correct about the execution
Q88: What will be the output of the
Q89: Is the code snippet written below legal?
String
Q91: How many times does the following loop
Q95: What is the last output line of
Q115: In the following code snippet, when does
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents