goto in Java bytecode

后端 未结 9 673
一向
一向 2020-12-16 11:58

So the other day when I was looking at the wikipedia page for Java bytecode I came across this example:

Consider the following Java code:

9条回答
  •  感动是毒
    2020-12-16 12:28

    Goto statements in programming are one way statements where as function calls are two way switch that is it will return back to the called section of the code.

    To use those only bytecodes use goto in them. In case if user is allowed to use goto means we may use it in a inefficient way (say unconditioned goto statement) which will never let the program to terminate.

    Jvm is such intelligent that never let the program run infinitely.

提交回复
热议问题