; * admin/notes/java: Document substitutes for `goto' in Java.

This commit is contained in:
Po Lu 2025-03-29 22:37:39 +08:00
parent f60fc1287d
commit 04bd649730

View file

@ -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
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