Team4567 / Processing

Processing Examples
0 stars 0 forks source link

When do you need a ;? #2

Open jamespec opened 5 years ago

jamespec commented 5 years ago

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 { };