Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 20th, 2010 | Syntax: None | Size: 0.50 KB | Hits: 73 | Expires: Never
Copy text to clipboard
  1.  
  2.  
  3. package algorytmylab4;
  4.  
  5. public class Wezel
  6. {
  7.     Karta dane;
  8.     public Wezel nastepny;
  9.  
  10.    
  11.     public Wezel (Karta value)
  12.     {
  13.         nastepny = null;
  14.         dane = value;
  15.     }
  16.  
  17.     public void add(Wezel we)
  18.     {
  19.         if(nastepny == null)
  20.             nastepny = we;
  21.         else
  22.             nastepny.add(we);
  23.     }
  24.  
  25.     public void wyswietl()
  26.     {
  27.         dane.wyswietl();
  28.         if(nastepny != null)
  29.         {
  30.             nastepny.wyswietl();
  31.         }
  32.     }
  33.  
  34. }