Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Java: Write the code for a class Football with at least 3 class member variables (instance variables) that describe a ball that is used
Using Java: Write the code for a class Football with at least 3 class member variables (instance variables) that describe a ball that is used to play soccer (European or Latin American football game) Your class should have at least two constructors: one with no parameters, and one with parameters that initializes all the member variables in the class. Your class should have toString() method, that allows you to see the contents of the class, when printed. Your class also should have 3 "setter" methods, such as setWeight(...), and three "getter" methods, such as getWeight(). Then make another class with main() method. You can call it FootballTester that will initialize 4 Football objects, by using your Football class. Use constructor with parameters to set at least two of the objects, while creating them. Change the internal data of one of the objects by using "setter" methods, such as setColor(...) . Use toString() method to see all your Football objects when printed at the end
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Heres the implementation of the Football class java public class Football Class member variables pri...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started