It203: Advanced Programming (Java) Example Worksheet - 3 Lab Class: Labweek-3 (October 10-14 2011)

You might also like

Download as odt, pdf, or txt
Download as odt, pdf, or txt
You are on page 1of 1

IT203: Advanced Programming (Java) Example Worksheet - 3 Lab Class : LabWeek-3 ( October 10-14 2011 ) 1- Produce a Team class

(as a superclass) and FootballTeam and BasketballTeam classes (as subclasses). Team class should contain class variables to count number of basketball teams created and all teams. A team name and championship object variables should be added as well. Overload a constructor properly. Subclasses should contain Football and Basketball related extra fields different from inherited Team fields. Choose and use them. Don't forget to override toString methods. In the main method, produce an array of Teams which is combination of Football and Basketball teams. produce only class instances as well. Write a for loop to print details of all teams.

You might also like