Question: Consider this following code: public interface Sport t public String getSportsName public String geteacueName) public class MainClassf public static void main(String[l args) Arrayist listnew Arrayist

 Consider this following code: public interface Sport t public String getSportsName

Consider this following code: public interface Sport t public String getSportsName public String geteacueName) public class MainClassf public static void main(String[l args) Arrayist listnew Arrayist( ist.add(getsport" Football")); ist.addlgetSport"Basketball")D for(Sport s: list) public static Sport getSport(String name) if oame.eguals(" Football")) return new Football(); return new Basketball return null else if(pame.equals("Basketball") else The output of this code is: Sport-Football, league NFL Sport-Basketball, league NBA Write your code for Football and Basketball class Football Class class Football implements Sport //write code here: Basketball class class Basketball implements Sportf //write code here

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To implement the Football and Basketball classes ensure they provide specific implementations for th... View full answer

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 Databases Questions!