Question
Line 95. public class Mom Line 96.{ Line 97. public PartyPlanner Planner; Line 98. public int StressLevel; Line 99. } Line 100. Line 101. public
Line 95. public class Mom
Line 96.{
Line 97. public PartyPlanner Planner;
Line 98. public int StressLevel;
Line 99. }
Line 100.
Line 101. public void ThrowParty()
Line 102.{
Line 103. Balloon birthdayBalloon = new Balloon();
Line 104. birthdayBalloon.Color = "Blue";
Line 105.
Line 106. Balloon stevesBalloon = birthdayBalloon;
Line 107. stevesBalloon.Color = "Green";
Line 108.
Line 109. this.PaintBalloonRed(birthdayBalloon);
Line 110.
Line 111. this.Planner.ThrowParty(stevesBalloon);
Line 112.}
Line 113.
Line 114. public void PaintBalloonRed(Balloon balloon)
Line 115.{
Line 116. balloon.Color = "Red";
Line 117.}
1. If a breakpoint were set and the debugger stopped on line 107, how many Balloon objects would be in memory?
2.If a breakpoint were set and the debugger stopped on line 115, how many Balloon objects would be in memory?
3.If a breakpoint were set and the debugger stopped on line 115, what is the Color of balloon?
4.If a breakpoint were set and the debugger stopped on line 112, how many Balloon references would there be?
5.If a breakpoint were set and the debugger stopped on line 112, what is the Color of stevesBalloon?
6.Where is the balloon variable being set in the code shown above?
Step 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