From 33399a1e39bf425d051c26ddabb86bffdcb46e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann-Ga=C3=ABl?= Date: Fri, 31 Aug 2018 15:03:01 +0000 Subject: [PATCH] Update Person.java Class Person should also have some common superclass with limbs... --- sdm/src/java/association/Person.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sdm/src/java/association/Person.java b/sdm/src/java/association/Person.java index 00dce43..373863e 100644 --- a/sdm/src/java/association/Person.java +++ b/sdm/src/java/association/Person.java @@ -2,11 +2,11 @@ public class Person { - int count; - Head head; - Torso torso; - Limbs limbs; - Person(int headCount, int torsoCount, int limbsCount) + int count; // Dead code, use your IDE to identify and remove dead code. + Head head; // Multiple instances rather than one instance with a count. + Torso torso; // Same + Limbs limbs; // Same + Person(int headCount, int torsoCount, int limbsCount) // Why not public? Also remove the "long" list of int parameters { head = new Head(headCount); torso = new Torso(torsoCount); @@ -14,7 +14,7 @@ public class Person } void showAll() { - System.out.println("New person created."); + System.out.println("New person created."); // Remove head.showAll(); torso.showAll(); limbs.showAll();