; * admin/notes/java: Document substitutes for `goto' in Java.
This commit is contained in:
parent
f60fc1287d
commit
04bd649730
1 changed files with 14 additions and 0 deletions
|
@ -452,6 +452,20 @@ on systems where shared object constructors are supported.
|
||||||
See http://docs.oracle.com/en/java/javase/19/docs/specs/jni/intro.html
|
See http://docs.oracle.com/en/java/javase/19/docs/specs/jni/intro.html
|
||||||
for more details.
|
for more details.
|
||||||
|
|
||||||
|
Java does not support `goto' statements, which it defines as reserved
|
||||||
|
identifiers but does not assign any syntatic role. If you are in a
|
||||||
|
position where you must exercise `goto' to exit a block prematurely, you
|
||||||
|
may define the block and exit it with a named `break' statement, thus:
|
||||||
|
|
||||||
|
label:
|
||||||
|
{
|
||||||
|
int x, y = foo ();
|
||||||
|
|
||||||
|
if (y)
|
||||||
|
break label;
|
||||||
|
x = something ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
OVERVIEW OF ANDROID
|
OVERVIEW OF ANDROID
|
||||||
|
|
Loading…
Add table
Reference in a new issue