Write all the contents of a java file named swimmerjava


Write all the contents of a Java file named ‘Swimmer.java'. This file contains the class Swimmer that represents some data about a competitive swimmer.

Every competitive swimmer is identified only by the following 3 attributes: category (with values like "100 m" or "4x200m"), a bestTime in miliseconds, and the indication that s/he is an olympian or not (true or false).

Write syntactically correct Java code for all the 3 attributes mentioned above (category, bestTime and olympian), its 3 accessor methods(get methods), its 3 mutator methods (set methods), and 2 appropriate constructor methods that initialize all its instance variables (one default and one with all attributes as parameters). You must also write an equals method that compares all attributes of the swimmer for equality. There is no need to add comments to the program. If you add comments you are wasting your time. Write only the required sentences.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write all the contents of a java file named swimmerjava
Reference No:- TGS02391949

Now Priced at $10 (50% Discount)

Recommended (97%)

Rated (4.9/5)