Question: 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
Do not use the scanner class or any other user input request. You application should be self-contained and run without user input. Assignment Objectives 1. Practice on implementing interfaces in Java o Football Player will implement the interface Table Member 2. Overriding methods o when Football Player implements TableMember, Football Player will have to write the real Java code for all the interface abstract methods Deliverables A zipped Java project according to the How to submit Labs and Assignments guide. O.O. Requirements (these items will be part of your grade) 1. One class, one file. Don't create multiple classes in the same.java file 2. Don't use static variables and methods 3. Encapsulation: make sure you protect your class variables and provide access to them through get and set methods 4. All the classes are required to have a constructor that receives all the attributes as parameters and update the attributes accordingly 5. All the classes are required to have an "empty" constructor that receives no parameters but updates all the attributes as needed 6. Follow Horstmann's Java Language Coding Guidelines 7. Organized in packages (MVC - Model - View Controller) Contents TableMember Person String name Height height int weight String hometown String highSchool public String getAttribute(int n); public ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
