Question: 2) For each snippet of code below, draw an object diagram showing the memory organization once the snippet of code has been executed. The variables

 2) For each snippet of code below, draw an object diagram
showing the memory organization once the snippet of code has been executed.
The variables p, q and r are all of type Person (as
defined in question 1)). Indicate on the object diagram any alias and

2) For each snippet of code below, draw an object diagram showing the memory organization once the snippet of code has been executed. The variables p, q and r are all of type Person (as defined in question 1)). Indicate on the object diagram any alias and any object that has been garbage- collected (see the given example). Example: Person p new Person): Person q-new Person); Person r= new Person(); q = null; The execution of the above code is illustrated by the following object diagram: Garbage collected Person null Person Garbage collected is an alias of p r is an alias of p a) Person p new Person(); Person q new Person); Person r new Person(); P q; q- r; r p; b) Person p new Person(); Person q p; p- new Person(); Person r p; p new Person); q p; p new Person(); p null; c) Person p new Person(); Person qnew Person(); Person r new Person(); p q qnull; q p

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!