Re: ";" after if statement??
- From: Roland <roland@xxxxxxxxx>
- Date: Sun, 29 May 2005 20:27:38 +0200
On 29-5-2005 20:00, JS wrote:
What does it mean when a ";" is inserted after an if statement?
if (x == 2){ System.out.println("x = 2"); };
It's a so-called empty statement. It does nothing.
However it can become unreachable (causing a compilation error), like in the following example:
public static int abs(int i) {
if (i<0) {
return -i;
} else {
return i;
}
; // unreachable
}-- Regards,
Roland de Ruiter ___ ___ /__/ w_/ /__/ / \ /_/ / \ .
- References:
- ";" after if statement??
- From: JS
- ";" after if statement??
- Prev by Date: Re: ";" after if statement??
- Next by Date: How we change Applet's parameters with HTML button or link?
- Previous by thread: Re: ";" after if statement??
- Next by thread: Re: ";" after if statement??
- Index(es):