PROPOSAL: open and close brace optional for single statement try, catch, finally, method declaration (original) (raw)
Ulf Zibis Ulf.Zibis at gmx.de
Mon Mar 30 08:01:49 PDT 2009
- Previous message: PROPOSAL: open and close brace optional for single statement try, catch, finally, method declaration
- Next message: PROPOSAL: open and close brace optional for single statement try, catch, finally, method declaration
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Am 30.03.2009 16:25, Neal Gafter schrieb:
Perhaps, but the Java grammar does not have a dangling-else ambiguity.
Neal, I don't understand. Please explain why Java does not have the dangling-else ambiguiaty.
if (..)
if (..)
...;
else
...;
is in fact:
if (..) {
if (..)
...;
else
...;
}
and not:
if (..) {
if (..)
...;
}
else
...;
Following "solution" should be a compile error:
if (..)
if (..)
...;
;
else
...;
-Ulf
- Previous message: PROPOSAL: open and close brace optional for single statement try, catch, finally, method declaration
- Next message: PROPOSAL: open and close brace optional for single statement try, catch, finally, method declaration
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]