You decide to recall the happy days of your childhood and play Heroes. Of course, you need an army.
Your task is to create objects: 5 Unit, 3 Knight, 1 General, 1 Doctor.
Don't forget to give them names!
class Unit {
String nameUnit;
public Unit(String name){
nameUnit = name;
}
}
class Knight {
String nameKnight;
public Knight(String name){
nameKnight = name;
}
}
class General {
String nameGeneral;
public General(String name){
nameGeneral = name;
}
}
class Doctor {
String nameDoctor;
public Doctor(String name){
nameDoctor = name;
}
}