Advertisement
programajster

Z5_Wyswietlacz

Apr 3rd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. package wyswietlacz;
  2.  
  3. public class Wyswietlacz {
  4.  
  5.     void wypisz(String komunikat, boolean jestWazny) {
  6.         if (!jestWazny) {
  7.             System.out.println(komunikat);
  8.         } else {
  9.             System.out.println(komunikat.toUpperCase());
  10.         }
  11.     }
  12.  
  13.     void wypisz(String komunikat) {
  14.         //System.out.println(komunikat);
  15.         wypisz(komunikat,false);
  16.     }
  17.  
  18.     public static void main(String[] args) {
  19.  
  20.         Wyswietlacz w1 = new Wyswietlacz();
  21.  
  22.         w1.wypisz("Ala ma kota");
  23.         w1.wypisz("Ala ma chomika", true);
  24.         w1.wypisz("Ala ma psa", false);
  25.  
  26.     }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement