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 is the difference between the jdk 1.02 event model and the event-delegation model introduced with jdk 1.1?
What are the advantages of packages in java?
What are methods and how are they defined?
How you can force the garbage collection?
What is an i/o filter?
Can we override tostring method in java?
Explain about fail fast iterators in java?
What is the use of arraylist in java?
How do you declare a variable?
Can It is possible to synchronize the constructor of a Java Class?
What is java ceil?
Is ++ operator thread-safe in java?
How to instantiate static nested classes in java?
Say any two properties in beans?
How do you create a first line indent?