Question: - Write a class named Basketball that has the following: - Fields (attributes): - Name of the team: String - Number of wins: int Constructor

 - Write a class named Basketball that has the following: -

- Write a class named Basketball that has the following: - Fields (attributes): - Name of the team: String - Number of wins: int Constructor and other methods: - First Constructor: accepts the name of the team, the number of wins as arguments and sets the class properties to those values. - Second Constructor: takes only the name of the team as an argument. This constructor should set the name of the team to the argument and sets the number of wins to 0 . - Accessors and Mutators: setters and getters for name of the team, and the number of wins. - Print Method: prints the name of the team and the numbers of wins. - Write a class named BasketballTeam, that has the main method, to do the following: - Create two objects of class Basketball using the two constructors above. - The teams' names are filled off the top of your head. - Fill the wins of the teams as follows: - The number of wins of the first team is filled with a random number in the range 010 upon creation of the object. - The number of wins of the second team is filled with a random number in the range 0 -10 using the wins mutator method. - Print the above objects' contents using your print method

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!