Assignment 7
Assignment 7
: 33 FYMCA-B
// Player class
import java.util.Scanner;
class Player {
this.name = name;
this.age = age;
super(name, age);
this.team = team;
super.displayDetails();
super(name, age);
this.club = club;
}
super.displayDetails();
super(name, age);
this.country = country;
super.displayDetails();
}
}
// Main class
name = sc.next();
age = sc.nextInt();
country = sc.next();
cricketPlayer.displayDetails();
name1 = sc.next();
age1 = sc.nextInt();
country1 = sc.next();
footballPlayer.displayDetails();
name2 = sc.next();
age2 = sc.nextInt();
country2 = sc.next();
hockeyPlayer.displayDetails();
Output