class Lamp {
public static final
ON = 0;
public void setLamp(
int setting ) {
if ( setting == ON ) //turn light on
else if ( setting == 1 ) // turn light off
else if ( setting == 2 ) // blink }
}
Lamp reading = new Lamp();
reading.setLamp( Lamp.ON );
reading.setLamp( 2 );
|