diff --git a/.idea/description.html b/.idea/description.html
new file mode 100644
index 0000000..db5f129
--- /dev/null
+++ b/.idea/description.html
@@ -0,0 +1 @@
+Simple Java application that includes a class with main()
method
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..ada92a5
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..8c84252
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..6dde7c1
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/project-template.xml b/.idea/project-template.xml
new file mode 100644
index 0000000..1f08b88
--- /dev/null
+++ b/.idea/project-template.xml
@@ -0,0 +1,3 @@
+
+ IJ_BASE_PACKAGE
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..4629ee3
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,358 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1680264526032
+
+
+ 1680264526032
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No facets are configured
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 13
+
+
+
+
+
+
+
+
+
+
+
+ zadanie
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/.editorconfig b/src/.editorconfig
new file mode 100644
index 0000000..e69de29
diff --git a/src/Defender.java b/src/Defender.java
new file mode 100644
index 0000000..99726c4
--- /dev/null
+++ b/src/Defender.java
@@ -0,0 +1,14 @@
+class Defender extends Player {
+ private int hits = 0;
+
+ public Defender(String name, int age, int hits) {
+ super.setType(Type.DEFENDER);
+ super.setName(name);
+ super.setAge(age);
+ this.hits = hits;
+ }
+
+ public int getHits() {
+ return this.hits;
+ }
+}
diff --git a/src/Forward.java b/src/Forward.java
new file mode 100644
index 0000000..d4b178e
--- /dev/null
+++ b/src/Forward.java
@@ -0,0 +1,15 @@
+class Forward extends Player {
+ private int goals = 0;
+
+ public Forward(String name, int age, int goals) {
+ super.setType(Type.FORWARD);
+ super.setName(name);
+ super.setAge(age);
+ this.goals = goals;
+ }
+
+ public int getGoals() {
+ return this.goals;
+ }
+
+}
diff --git a/src/Goalie.java b/src/Goalie.java
new file mode 100644
index 0000000..553483a
--- /dev/null
+++ b/src/Goalie.java
@@ -0,0 +1,16 @@
+class Goalie extends Player {
+ private int wins = 0;
+
+
+ public Goalie(String name, int age, int wins) {
+ super.setType(Type.GOALIE);
+ super.setName(name);
+ super.setAge(age);
+ this.wins = wins;
+ }
+
+ public int getWins() {
+ return this.wins;
+ }
+
+}
diff --git a/src/HockeyManager.java b/src/HockeyManager.java
new file mode 100644
index 0000000..70dda36
--- /dev/null
+++ b/src/HockeyManager.java
@@ -0,0 +1,60 @@
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class HockeyManager {
+
+ private List player_list;
+
+
+ public HockeyManager() {
+ player_list = new ArrayList<>();
+
+ }
+
+ public void AddNewForward(String name, int age, int goals) {
+ player_list.add(new Forward(name, age, goals));
+ }
+
+ public void AddNewDefender(String name, int age, int hits) {
+ player_list.add(new Defender(name, age, hits));
+ }
+
+ public void AddNewGoalie(String name, int age, int wins) {
+ player_list.add(new Goalie(name, age, wins));
+ }
+
+ public void PrintNameAndAgeOfTheYoungestPlayer() {
+
+ Collections.sort(player_list);
+ System.out.println(player_list.get(0).getName() + " " + player_list.get(0).getAge());
+
+ switch (player_list.get(0).getType()) {
+ case FORWARD:
+
+ System.out.println("Goals: " + ((Forward) player_list.get(0)).getGoals());
+ break;
+ case DEFENDER:
+
+ System.out.println("Hits: " + ((Defender) player_list.get(0)).getHits());
+ break;
+ case GOALIE:
+
+ System.out.println("Wins: " + ((Goalie) player_list.get(0)).getWins());
+ break;
+ default:
+ // code block
+ }
+
+
+
+/*
+ for (Player item : player_list) {
+ System.out.println(item.name);
+
+ }
+*/
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/Main.java b/src/Main.java
new file mode 100644
index 0000000..1c28ff9
--- /dev/null
+++ b/src/Main.java
@@ -0,0 +1,15 @@
+public class Main {
+
+ public static void main(String[] args) {
+
+
+ HockeyManager mngr = new HockeyManager();
+
+ mngr.AddNewForward("Wayne Gretzky", 5, 5);
+ mngr.AddNewDefender("Zigo Palfy", 4, 2);
+ mngr.AddNewGoalie("Jan Lasak", 3, 1);
+
+ mngr.PrintNameAndAgeOfTheYoungestPlayer();
+
+ }
+}
diff --git a/src/Player.java b/src/Player.java
new file mode 100644
index 0000000..bab1558
--- /dev/null
+++ b/src/Player.java
@@ -0,0 +1,64 @@
+public class Player implements Comparable {
+
+ enum Type {
+ DEFENDER,
+ FORWARD,
+ GOALIE,
+ NONE
+
+ }
+
+ private String name;
+ private int age;
+ private Type type;
+
+
+ public int getAge() {
+
+ return this.age;
+ }
+
+ public void setAge(int age) {
+
+ this.age = age;
+ }
+
+ public String getName() {
+
+ return this.name;
+ }
+
+ public void setName(String name) {
+
+ this.name = name;
+ }
+
+
+ public void setType(Type type) {
+
+ this.type = type;
+ }
+
+ public Type getType() {
+
+ return this.type;
+ }
+
+ public Player() {
+
+ this.name = "";
+ this.age = 0;
+ this.type = Type.NONE;
+ }
+
+
+ @Override
+ public int compareTo(Player another) {
+ if (this.age < another.age) {
+ return -1;
+ } else {
+ return 1;
+ }
+ }
+
+}
diff --git a/zadanie.iml b/zadanie.iml
new file mode 100644
index 0000000..5ce49f1
--- /dev/null
+++ b/zadanie.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file