Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. public class Solution {
  2.     public static void main(String[] args) {
  3.         //напишите тут ваш код
  4.     }
  5.  
  6.     public static class Human {
  7.         //напишите тут ваш код
  8.  
  9.         public String toString() {
  10.             String text = "";
  11.             text += "Имя: " + this.name;
  12.             text += ", пол: " + (this.sex ? "мужской" : "женский");
  13.             text += ", возраст: " + this.age;
  14.  
  15.             if (this.father != null)
  16.                 text += ", отец: " + this.father.name;
  17.  
  18.             if (this.mother != null)
  19.                 text += ", мать: " + this.mother.name;
  20.  
  21.             return text;
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement