Question: Create a class named Athlete. The class has the following instance variables, constructors, and methods. Private instance variables name of type String, country of type

Create a class named Athlete. The class has the following instance variables, constructors, and methods.
Private instance variables name of type String, country of type String, age of type int, and medals of type int
A public empty no-arg constructor
A public constructor that takes four arguments and sets the instance variables accordingly. Use the reference this in your implementation.
Public getter and setter methods for each of the instance variables country and medals. Use the reference this in the setter methods.
A public static method that takes two parameters of type Athlete and returns a boolean value. The method returns true if the instance variables age and medals of the first argument is equal to the instance variable age and medals of the second argument, respectively. The method's header is as follows:
public static boolean equals(Athlete a1, Athlete a2)
The method should also return true if a1 is equal to a2(reference variable comparison).
A public method named display() that displays the instance variables of the invoking object in a format of your choice.
Create a class named Athlete. The class has the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!