0
Goto statement in java?
5 Answers
+ 4
As far as I know, Java does not have a goto function. 'goto' is a reserved word, but it does not have an implementation.
The Java documentation mentions the same:
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html
+ 4
Here is an example of how you can implement something similar, although personally I do not see it as optimal.
If you really need to use goto, I think you should rethink the logic behind your code.
http://www.aboutcodes.com/2012/07/goto-statement-in-java-with-example.html
0
thanks ,
but which feature in Java replace goto statment?
0
Loops,break, continue and functions in some sense, also there is a goto instruction in the bytecode the jvm interprets
0
thanksđ