Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class RasowyPies extends Pies {
- String rasa;
- String ojciec;
- String matka;
- public RasowyPies(int identyfikator, String rasa, String wabiSie, String kolor, int wiek, String matka, String ojciec,
- String imie, String nazwisko) {
- super(identyfikator, wabiSie, kolor, wiek, imie, nazwisko,);
- this.rasa = rasa;
- this.ojciec = ojciec;
- this.matka = matka;
- }
- public String toString() {
- String result = super.toString();
- result += "\n" + " Pies rasowy" + "\n";
- result += "----------------------------------------------\n";
- result += " RASA: " + rasa + "\n";
- result += " MATKA: " + matka + "\n";
- result += " OJCIEC: " + ojciec + "\n";
- result += " MIOT: " + wabiSie.charAt(0)-'A' + 1 + "\n";
- result += "----------------------------------------------\n";
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement