1 2 3 4 5 6 7 8 9 | public YellowCar() //Constructor { if ( YellowCar = 1 ); setRotation( 90 ); //set rotation to north if ( else YellowCar = 2 ); setRotation( 0 ); } } |


1 2 3 4 5 6 7 8 9 | public YellowCar() //Constructor { if ( YellowCar = 1 ); setRotation( 90 ); //set rotation to north if ( else YellowCar = 2 ); setRotation( 0 ); } } |
1 2 3 4 | public YellowCar( int direction) { if (direction == 0 ) setRotation( 90 ); } |
1 | if ( YellowCar = 1 ); |
1 | if ( else YellowCar = 2 ); |
1 2 3 | else if (condition) { //statements; } |
1 | addObject( new YellowCar( 0 ), 30 , 15 ); |