The following code compiled, but while running it the program appears to hang (e.g. nothing happens). This is a clear sign of an infinite loop. What part of this code fragment caused the infinite loop?
while(i < 50); {
System.out.println(i);
i+=2;
}
Correct Answer:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q22: Write a code fragment that determines how
Q23: An infinite loop is a compile-time error.
Q24: Write a code fragment that allows a
Q25: A Scanner object can use delimiters other
Q26: Rewrite the following code fragment using a
Q28: It is possible to implement a switch
Q29: Write a switch statement that switches on
Q30: Write a short code fragment that uses
Q31: Rewrite the following for loop as a
Q32: What is output by the following code
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