Question: Objectives: We know the benefits of using classes in java. However, what if we want to create a class inside of a class? Is this

Objectives: We know the benefits of using classes in java. However, what if we want to create a class inside of a class? Is this even possible? Yes, it is. This is known as nested classes. A programmer may want to do this when they want to group classes logically, increase encapsulation, and make code more maintainable and readable. By completing this assignment, students will demonstrate knowledge of creating nested classes.
Task Description: The sports association wants you to continue development of the soccer league. Using your previous assignment on the soccer league, you will add some additional features. They want to be able to track in-game statistics. These should be built in as nested classes in the Player and Team classes.
Class Layout (Game and Coach classes are omitted because they do not change):
Team (Class):
Name
City
Color
Roster(ArrayList of players)
Statistics (Class):
Team Goals
Team Assists
Team Tackles
Wins
Losses
Ties
Player (Class):
Name
Age
Position
Team
Statistics (Class):
Goals
Assists
Tackles
Saves (Goalkeeper saves)
You are supplied with a playerStats.txt file. This file contains the statistics for players. Each player is identified by name and team name. These statistics are taken from different games, so as they are being read each they should be added to the appropriate player's stats as well as the team's stats.
 Objectives: We know the benefits of using classes in java. However,

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