Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: Java  |  size: 0.58 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2. public class Beleuchtung
  3. {
  4.         private int wert = 0;
  5.        
  6.         public void heller( )
  7.           {
  8.             if (wert < 9 )
  9.             {
  10.                 wert++;
  11.                 System.out.println("Beleuchtung hat nun den Wert: " + wert + " ####.");
  12.             }
  13.             else
  14.             {
  15.                 System.out.println("Maximale Helligkeit (9) erreicht.");
  16.             }
  17.           }
  18.           public void dunkler( )
  19.           {
  20.                   if (wert > 0 )
  21.                     {
  22.                         wert--;
  23.                         System.out.println("Beleuchtung hat nun den Wert: " + wert + " ####.");
  24.                     }
  25.                     else
  26.                     {
  27.                         System.out.println("Minimale Helligkeit (0) erreicht.");
  28.                     }
  29.           }
  30.         }