Question
Hi, can someone help me with this task in Java? 1. Implement an abstract class called Sport ( part of the package Sporty) with name
Hi, can someone help me with this task in Java?
1. Implement an abstract class called Sport ( part of the package Sporty) with name and age characteristics. The class needs to have an abstract method named setAge() and an usual method called printDatas().
Also, Implement the class Footballer ( part of the package Footballers which extends the abtsract class Sport. The class Footballer has: 1 constructor which only initializes the name of the Footballer (and puts the age on 0 (zero)) The method printDatas() which describes completely the Footballer class ( name and age) and which writes these datas to a file on the computer, whose name ( of the file) will be written from the keyboard. The Age characteristics is read from the keyboard regarding the method setAge() and also we need to treat the exception if an user does not introduce an integer number.
Implement a public class called Competition part of the package Competitions in which we instantiate 3 times the class Footballer and call the methods setAge() and printDatas() on the created instance. The 3 instances will be saved into a collection of objects if type LinkedList.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started