aspose file tools*
The moose likes Beginning Java and the fly likes using semicolons; Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "using semicolons;" Watch "using semicolons;" New topic
Author

using semicolons;

edi kapllani
Greenhorn

Joined: Sep 14, 2001
Posts: 5
tryig I noted that with or without semicolons at the end of anny bock of code I have the same results.
Can anyone explain how semicolons are used ?
ex:
public class AA{
public static void main(String args[]) {
while (x < 4) {
switch (x) {
//
};
};
};
};
is the same with:
public class AA{
public static void main(String args[]) {
while (x < 4) {
switch (x) {
//
}
}
}
}
thanks!
ciao!

------------------
edi


edi
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
You don't need semi-colons at the end of blocks. You have just added a bunch of "empty statements" into your code, which doesn't HURT anything, but is a waste of CPU and confusing to the next guy.
Semi-colons are used to end statements, not blocks.
[This message has been edited by Cindy Glass (edited September 17, 2001).]


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: using semicolons;