Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Pies {
- private int identyfikator;
- protected String wabiSie;
- private String masc;
- private int wiek;
- private String imie;
- private String nazwisko;
- private int miot;
- public Pies(int identyfikator, String wabiSie, String masc, int wiek, String imie, String nazwisko, int miot) {
- this.identyfikator = identyfikator;
- this.wabiSie = wabiSie;
- this.masc = masc;
- this.wiek = wiek;
- this.imie = imie;
- this.nazwisko = nazwisko;
- this.miot = miot;
- }
- public String toString() {
- String result = "";
- result += "----------------------------------------------" + "\n";
- result += " identyfikator: " + identyfikator + "\n";
- result += " WLASCICIEL: " + imie + " " + nazwisko + "\n";
- result += "\n";
- result += " IMIE: " + wabiSie + "\n";
- result += " masc: " + masc + "\n";
- result += " wiek: ";
- if (wiek > 12)
- result += (wiek / 12) + " rok " + "i " + (wiek % 12) + " miesięcy" + "\n";
- result += "----------------------------------------------";
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement