Write the class header and the variable declarations for Ath…
Write the class header and the variable declarations for Athlete (an abstract class). All subclasses of Athlete must satisfy the requirements of the Competitive interface. Athlete has the following variables: name (String instance variable) salary (double instance variable) population (int class variable that keeps track of how many athletes exist; make sure it starts at 0) Do not write constructors or methods, just what is asked above. Proper syntax is still required.
Read DetailsWhat is the output of the following code snippet? Assume all…
What is the output of the following code snippet? Assume all necessary imports have been made. If there is a compiler/runtime error, please state which one it is and provide a reason for it. String[] animals = {“bird”, “rat”, “zebra”, “rattlesnake”, “bear”};Arrays.sort(animals);for (String a : animals) { System.out.print(a + ” “);}
Read DetailsWrite a concrete method with protected visibility for Athlet…
Write a concrete method with protected visibility for Athlete called swapJersey. It receives one parameter of type Athlete (called player2), which indicates who the Athlete is swapping jerseys with. If player2’s salary is greater than that of the Athlete, the Athlete’s salary is increased by player2’s salary. If player2’s salary is less than or equal to that of the Athlete, the Athlete’s salary is set to player2’s salary.
Read Details