
Untitled
By: a guest on
May 9th, 2012 | syntax:
Java | size: 0.58 KB | hits: 16 | expires: Never
public class Beleuchtung
{
private int wert = 0;
public void heller( )
{
if (wert < 9 )
{
wert++;
System.out.println("Beleuchtung hat nun den Wert: " + wert + " ####.");
}
else
{
System.out.println("Maximale Helligkeit (9) erreicht.");
}
}
public void dunkler( )
{
if (wert > 0 )
{
wert--;
System.out.println("Beleuchtung hat nun den Wert: " + wert + " ####.");
}
else
{
System.out.println("Minimale Helligkeit (0) erreicht.");
}
}
}