Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create two classes (class1 & class2, one for each thing - choose a good name for each class), for each class: Identify at least
Create two classes (class1 & class2, one for each thing - choose a good name for each class), for each class: Identify at least 3 attributes - an int/double, a String, a boolean and a constant must be present in at least one of the classes. Design an alternate constructor. Create the accessors and mutators for each attribute. Design a suitable toString() Create a main class (choose a name for it). Create a Scanner object as a local variable in the main class - where ever it is needed. The main class creates an object of class1 and an object of class2 as attributes choose appropriate names for them. The default constructor should initialise both objects. Each object's contents should be displayed using the toString(). User entry must change both objects in some way (using mutators). User must be presented with a decision and the response processed appropriately using an if statement. Use multiple methods in the main class - where appropriate.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Ill provide you with a Java program that includes two classes Class1 and Class2 and a main class to demonstrate object creation attribute manipulation ...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