Results 1 to 3 of 3
Thread: Double semicolon, why no error?
- 03-13-2011, 11:20 AM #1
Senior Member
- Join Date
- Feb 2011
- Posts
- 107
- Rep Power
- 0
Double semicolon, why no error?
This is rather trivial but I'm still interested to know what is going on.
I was working on a piece of code and accidentally closed off a statement with ;; instead of just ;
Surprisingly (at least to my novice self) the program compiled just fine and did what it was supposed to do.
Would one of our good seniors explain to this lowly student why this is so :D
- 03-13-2011, 11:48 AM #2
Because the empty statement is legal in Java.
db
- 03-13-2011, 12:10 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,412
- Blog Entries
- 7
- Rep Power
- 17
When people rob a bank they get a penalty; when banks rob people they get a bonus.
Similar Threads
-
double a * double b = weird output
By GPB in forum New To JavaReplies: 3Last Post: 03-26-2010, 10:40 AM -
non-static method add(double,double) cannot be referenced from a static context
By cravi85 in forum Java SoftwareReplies: 5Last Post: 03-21-2009, 09:32 PM -
Double.valueOf() vs Double.parseDouble()
By greenbean in forum New To JavaReplies: 10Last Post: 01-12-2009, 08:39 AM -
Let eclipse warn about a semicolon after an if statement and string == string?
By foobar.fighter in forum EclipseReplies: 5Last Post: 01-11-2009, 10:12 AM -
printf error with int and double
By o0n1 in forum New To JavaReplies: 1Last Post: 09-18-2008, 08:58 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks