What are the types of loops in Java, and how are they used?
Answer Posted / nashiinformaticssolutions
• In Java, for loops are used to repeatedly run statements for a specified number of times. When a programmer knows how many times to run a statement, they use a for loop.
•When some statements must run continuously until a condition is met, the while loop can be helpful. Before statements are executed in while loops, the condition is checked.
•With the exception of checking the condition after a block of statements has been executed, the do while loop is identical to the while loop. Do while loop statements should also run at least once.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are new features introduced with java 8 ?
Can a class declared as private be accessed outside it’s package?
How can we make string upper case or lower case?
What is difference between final and finally in java?
Explain about fail safe iterators in java?
Does treeset allow null in java?
Which is fastest collection in java?
What is null statement?
What is sortedset in java?
What are mutable classes?
What does the “static” keyword mean? Can you override private or static method in java?
What is flag in java?
Is java a pure object oriented language?
What technique can be employed to compare two strings?
Why webdriver is an interface?