What will be the output of the following code snippet?
Boolean token1 = true;
While (token1)
{
For (int i = 0; i < 10; i++)
{
System.out.println("Hello") ;
}
Token1 = false;
}
A) No output.
B) Hello will be displayed 10 times.
C) Hello will be displayed 9 times.
D) Hello will be displayed infinite times.
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
Q87: Is the following code snippet legal?
Boolean b
Q89: Is the code snippet written below legal?
String
Q91: How many times does the following loop
Q93: What will be the output of the
Q95: What is the last output line of
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