+ 2
Semi-colon
Why should we not use a semi-colon while declaring a class or after a method? Is there a reason or it just needs to?
2 Antworten
+ 3
Semi-colon is used to indicate instruction end.To separate statement in some languages.C C++ javascript java ...Else compiler can not understand your code.It is used also in clasd declaration in c c++ only.
+ 2
In java, semi colon denotes end of statement.
That's the way syntax of those is designed by the Java developers...
Where you actually you are taking about? Can you give an example?
After the class means.?
Class definition should be like
class class_name {
...
} //if you mean here, if you put, then it's not error, it's not belongs to class,, and just a unnecessary extra char...
Similarly for method..
You just put statements between {//here....} as a block statements....