Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The Interface it is an interface remember the interface definition Interfaces are often compared to a contract, to a promise to implement the methods described
The Interface
- it is an interface
- remember the interface definition
-
Interfaces are often compared to a contract, to a promise to implement the methods described in the interface. An interface in Java does not have any real code for implementation of its methods, it has only the skeleton of the methods. When a class decides to implement an interface, it has to contain the real code for each method in the interface.
-
- These are the four methods that FootballPlayer has to implement
-
public String getAttribute(int n); Returns the value of a specific attribute. The input parameter start with 0 for the first attribute, then 1 for the second attribute and so on.
-
public ArrayList
getAttributes(); Returns the value of all attributes as an ArrayList of Strings. -
public String getAttributeName(int n); Returns the name of a specific attribute. The input parameter start with 0 for the first attribute, then 1 for the second attribute and so on.
-
public ArrayList
getAttributeNames(); Returns the name of all attributes as an ArrayList of Strings. the abstract methods are
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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