testinganswers.com

Category: 09 Control Flow Part-3

09.3 Control Flow

9.3 | Transfer Statement Java provides six language constructs to transfer control or exit loops in a program. break continue return try …catch …finally throw assert   break …statement   break …statement terminates a loop.   For example, the following code showed how to terminate a while and for a loop.   continue …statement continue …statement exits the current iteration and starts executing the next iteration. For example, the following code prints all numbers except number 3. return …statement return …statement stops code execution of a method and transfer control back to the calling code. try …catch …finally …statement try Read More