Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using semicolons;

 
edi kapllani
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic