Ask Question

In Java, it is possible to create an infinite loop out of while and do loops, but not for-loops. true or false

+3
Answers (1)
  1. 1 July, 20:07
    0
    False is the correct answer for the above question.

    Explanation:

    In java programming language or any other programming language, any loop can be infinite. It is because the infinite loop is called for that loop which is not run in a finite number of times. The loop is used to repeat some lines in a finite number of times. Any loop has three things - first is the initial value which tells the loop to start, The second is the condition check which states when the loop will stop and the third is an operation which directs some variable, so that the condition may be false after some finite amount of time. If the condition will not false in any iteration of the loop, then the loop can proceed for an infinite amount of time. The above-question states that the while loop and do while loop can be infinite which is a true statement. But it also states that the 'for' loop can not be infinite which is not a correct statement which is described above. Hence false is the correct answer to the above question.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “In Java, it is possible to create an infinite loop out of while and do loops, but not for-loops. true or false ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers