Saturday, 12 April 2014

Difference between continue,return,break,exit statements


Continue = Its stop the current iteration and continue witn next iteration. That means its skip the remaining statements with in the braces ({}), and continue the process in next set of stataments.

Return = Its used to retun from the Loop statements. That means its not executed the remaining statements inside the loop and come out from the loop.

Break = Its used to come out from calling function. That means its not executed the remaining statements inside the calling function and come out from the function.

Exit = Its used to terminate the current Program or process.

No comments:

Post a Comment