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 relationship difference the canvas class and the graphics class?
Can we create constructor in abstract class ?
What happens if I remove static from main method?
What are the disadvantages of object oriented programming?
What is application system?
Can a serialized object be transferred via network?
Why can't we use static class instead of singleton?
What are the differences between string and stringbuffer?
Is it compulsory for a try block to be followed by a catch block in java for exception handling?
Explain about strings in java?
What do you understand by soft reference?
What is instance synchronization?
23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an
There are two classes named classa and classb. Both classes are in the same package. Can a private member of classa can be accessed by an object of classb?
What are classloaders?