Hello !
How can I get a class out of the collection (by example)
There is an abstract class Игрок :
public Player(String firstName, String lastName, int age) { this.firstName = firstName; this.lastName = lastName; this.age = age; } There is a class Вратарь
public GoalKeeper(String firstName, String lastName, int age, int handling, int aerialAbility) { super(firstName, lastName, age); this.handling = handling; this.aerialAbility = aerialAbility; } Later, I create an object and place it in the Игрок type collection (abstract class)
players = new ArrayList<Player>(); players.add(new GoalKeeper("Олег", "Газманов", 11, 44, 35)); How can I get data from the Вратарь class from this collection? Thank !