Purpose of goto in java -
this question has answer here:
- is there goto statement in java? 24 answers
i know goto
keyword in java. also, wiki, can excerpt that, "it not used , has no function".
i wonder, why goto
declared keyword if has no use , not used anywhere? did ever used goto
in java program? there other keywords goto declared in java programming had metaphorically no use.
where use goto in our daily programming or when?
here bit of summary goto statements
usage:
they used jump out of block of statements in language, jmp instruction work @ assembly level.
goto's strictly prohibited make program difficult trace excessive jumps in code makes slow. imagine loop having goto inside it. not @ good.
java reserved keyword may involves native code inside jvm(that's bit of c/c++) code, may avoid ambiguity.
java provides break implementation of goto usage limited , should not used often.
Comments
Post a Comment