A semi-colon (;) is needed only at the end of a java command. It is not used in conditional expressions or required at the end of a block of code { }. It is required at the end of a class definition:
x = x + 1;
if( x == 1 )
y = 7;
if( x == 1 ) {
y = 7;
q++; // short hand for q = q + 1
}
A semi-colon (;) is needed only at the end of a java command. It is not used in conditional expressions or required at the end of a block of code { }. It is required at the end of a class definition:
x = x + 1;
if( x == 1 ) y = 7;
if( x == 1 ) { y = 7; q++; // short hand for q = q + 1 }
class Ball { };