Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. public class Pies {
  2.  
  3. private int identyfikator;
  4. protected String wabiSie;
  5. private String masc;
  6. private int wiek;
  7. private String imie;
  8. private String nazwisko;
  9. private int miot;
  10.  
  11. public Pies(int identyfikator, String wabiSie, String masc, int wiek, String imie, String nazwisko, int miot) {
  12. this.identyfikator = identyfikator;
  13. this.wabiSie = wabiSie;
  14. this.masc = masc;
  15. this.wiek = wiek;
  16. this.imie = imie;
  17. this.nazwisko = nazwisko;
  18. this.miot = miot;
  19.  
  20. }
  21.  
  22. public String toString() {
  23. String result = "";
  24. result += "----------------------------------------------" + "\n";
  25. result += " identyfikator: " + identyfikator + "\n";
  26. result += " WLASCICIEL: " + imie + " " + nazwisko + "\n";
  27. result += "\n";
  28. result += " IMIE: " + wabiSie + "\n";
  29. result += " masc: " + masc + "\n";
  30. result += " wiek: ";
  31. if (wiek > 12)
  32. result += (wiek / 12) + " rok " + "i " + (wiek % 12) + " miesięcy" + "\n";
  33. result += "----------------------------------------------";
  34. return result;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement