Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please answer question 3,4 and 5 (13 unsider the following class and the main below. Trace the code then answer the questions on the right
please answer question 3,4 and 5
(13 unsider the following class and the main below. Trace the code then answer the questions on the right public class SomeClass { 3. How many objects are created in the main? private String aName; private int aNumber; 4. What is the initial state of each private boolean amAwesome; object? (What are the values of each public SomeClass(String name, int number) { object's variables?) aName = name; aNumber = number; amAwesome = true; } public SomeClass(String name, int number, boolean awesome) { aName = name; aNumber - number; 5. What is the state of each object amAwesome awesome; just before the main method exits? } public void methodAwesome (int number) { if(amAwesome) aNumber += number - 5; amAwesome = I amAwesome; } public int methodFantastic boolean fantastic){ fantastic = fantastic && anAwesome; if(!fantastic && aNumber > 0) aName - aName + is fantastic"; return aNumber *. -2; } public void methodAmazing(int num) { if(aNumberStep by Step Solution
There are 3 Steps involved in it
Step: 1
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