From 4f6f24ff8254617c8621501d84e6adc5f259bf51 Mon Sep 17 00:00:00 2001 From: "artem.didytschuk" Date: Sun, 6 Dec 2020 20:05:00 +0100 Subject: [PATCH] implemented newAthlete() --- Athlete.java | 4 ++-- Competition.java | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 Competition.java diff --git a/Athlete.java b/Athlete.java index c677160..49dd017 100644 --- a/Athlete.java +++ b/Athlete.java @@ -12,8 +12,8 @@ public class Athlete implements ComparableContent{ long startTime; long endTime; - public Athlete(String pName) { - name = pName; + public Athlete() { + } public String getName(){ diff --git a/Competition.java b/Competition.java new file mode 100644 index 0000000..a54f0d4 --- /dev/null +++ b/Competition.java @@ -0,0 +1,19 @@ + + +public class Competition +{ + List athletes; + + public Competition() + { + athletes = new List(); + } + + public void newAthlete(){ + athletes.append(new Athlete()); + } + + + + +}