Why goto statements are not available in Java?

1) goto statement lead to confusion for a programmer. Especially in large program, if several goto statements are used then the programmer would perplexed while understanding the flow.
2) goto statements make documentation of a program difficult.
3) goto statements are not part of structured programming.
Because of these reasons the goto statement is not supported in java

Note: The goto statement is reserved keyword in Java.

No comments:

Post a Comment