diff options
| author | Po Lu | 2025-03-29 22:37:39 +0800 |
|---|---|---|
| committer | Po Lu | 2025-03-29 22:44:59 +0800 |
| commit | 04bd6497300789cd90b365299885517d92292648 (patch) | |
| tree | 9f06ff43a4a6bf38ae02ca6d1dc6e2427c84d38b /admin/notes/java | |
| parent | f60fc1287d499e8c93857b1b96e8bd2467b22c8d (diff) | |
| download | emacs-04bd6497300789cd90b365299885517d92292648.tar.gz emacs-04bd6497300789cd90b365299885517d92292648.zip | |
; * admin/notes/java: Document substitutes for `goto' in Java.
Diffstat (limited to 'admin/notes/java')
| -rw-r--r-- | admin/notes/java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/admin/notes/java b/admin/notes/java index 0bfdff339cb..9a7c925e123 100644 --- a/admin/notes/java +++ b/admin/notes/java | |||
| @@ -452,6 +452,20 @@ on systems where shared object constructors are supported. | |||
| 452 | See http://docs.oracle.com/en/java/javase/19/docs/specs/jni/intro.html | 452 | See http://docs.oracle.com/en/java/javase/19/docs/specs/jni/intro.html |
| 453 | for more details. | 453 | for more details. |
| 454 | 454 | ||
| 455 | Java does not support `goto' statements, which it defines as reserved | ||
| 456 | identifiers but does not assign any syntatic role. If you are in a | ||
| 457 | position where you must exercise `goto' to exit a block prematurely, you | ||
| 458 | may define the block and exit it with a named `break' statement, thus: | ||
| 459 | |||
| 460 | label: | ||
| 461 | { | ||
| 462 | int x, y = foo (); | ||
| 463 | |||
| 464 | if (y) | ||
| 465 | break label; | ||
| 466 | x = something (); | ||
| 467 | } | ||
| 468 | |||
| 455 | 469 | ||
| 456 | 470 | ||
| 457 | OVERVIEW OF ANDROID | 471 | OVERVIEW OF ANDROID |