Family census

  • 10
  • Locked
Let's try to create a program for a family census. To do this, we'll write a Human class with String name, boolean sex, int age, Human father, and Human mother fields. To practice, create objects and fill them with data so we end up with two grandparents, two grandmothers, a father, a mother, and three children. Display the objects on the screen.
You can't complete this task, because you're not signed in.
Comments (10)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
NaTasia Madison
Level 8 , Atlanta, United States
23 September 2021, 12:45
I understood the problem, I just had a different output for the parents and grandparents. Other than that, I got the concept. Just need to read the problem clearly. I analyze it too deeply. LOL
Usman Full Stack Developer at QA
11 July 2021, 10:48
is it just me or im not exactly sure why this is HARD 10x challange. it didnt really require much logic, just syntax i guess. I found it pretty easy in compairson to some of the other ones...
Level 8 , Texas, United States
1 February 2021, 20:59
I wish I had more output solutions like this task. Solved it on the first try!!! :) sweet!
Level 27 , London, United Kingdom
10 August 2020, 09:08
If you add System.out.println(toString()) to the constructor. It will print the toString() method each time an object is created.
Level 15 , Providence, United States
25 June 2020, 02:50
this task was sweet ... got it on the first try :)
Kent Hervey Software Engineer/Consult at Zeal IT ConsultantsExpert
23 November 2019, 20:03
Here is a tip from where I stumbled. When they say "four four argument constructors...that includes the ones created for the parents
David J. Malan
Level 19 , Bishkek, Kyrgyzstan
15 March 2019, 13:50
If you use Boolean instead of boolean you will not pass the server test. Be careful
Muhammad Vahhaaj
Level 19 , Rawalpindi, Pakistan
3 July 2019, 06:38
why so, i think there is not boolean but Boolean in java
Level 16 , Houston, United States
8 November 2019, 18:28
boolean is a primitive datatype, Boolean is a generic, i think
Show How
Level 13 , Manchester, United Kingdom
2 May 2020, 17:16
boolean is a primitive data type while Boolean is wrapper class.