Question: Q 2 . Given the following java class on left, what is the output of running the main method on right? Show your work and
Q Given the following java class on left, what is the output of running the main method on right? Show your work and draw objects in RAM for partial credit.
Marks
public class Event
private int days;
public static int count ;
public Event this;
public Eventint value
this.days value;
count;
public int getDaysreturn days;
public void setDaysint days
this.days days;
public static void inc
count ;
public Event similar
return this;
public void changeEvent d
this.days ddays ;
count count ;
d days count;
public class TestEvent
public static void mainString args
Event olymbics new Event ;
System.out.println olymbicsgetDays ;
System.out.println Event count;
Event games new Event;
for int ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
