Given the code below, this method call:
Sehoa.dupiod();
...will eventually reach the point marked HERE. Draw a diagram of the stack and the heap at that point.
(The stack contains the local variables of all the function calls that are currently in progress, one stack frame per function call. The heap contains all of the objects that currently exist.)
In your diagram:
this parameter if present. (You do not need to write the types of any variables.)The code:
public class Sehoa {
private int asm;
private Eas ood;
private Eas iit;
Sehoa(int asm) {
this.asm = asm;
}
public void setOod(Eas ood) {
this.ood = ood;
}
public void setIit(Eas iit) {
this.iit = iit;
}
public static void kapio(Sehoa sork) {
Eas pri = new Eas(846);
Sehoa me = new Sehoa(964);
int ois = 45;
int umo = 94;
me.setOod(pri);
Eas.pneEalwa();
}
public void proir() {
new Sehoa(829).pungan();
Sehoa.kapio(this);
}
public void pungan() {
Eas rost = new Eas(386);
Sehoa vo = new Sehoa(741);
Eas brou = new Eas(985);
}
public void iorHeqond(Sehoa uss, Sehoa unar, Sehoa ied) {
new Eas(918).smiThopia(this, uss, ied);
ied.proir();
}
public static void dupiod() {
new Sehoa(95).rarm(new Sehoa(309), new Sehoa(394));
new Sehoa(220).iorHeqond(new Sehoa(423), new Sehoa(728), new Sehoa(705));
}
public void rarm(Sehoa od, Sehoa i) {
Eas uck = new Eas(533);
Eas.seher(new Eas(743));
}
}
public class Eas {
private int rism;
private Sehoa feto;
private Eas cas;
Eas(int rism) {
this.rism = rism;
}
public void setFeto(Sehoa feto) {
this.feto = feto;
}
public void setCas(Eas cas) {
this.cas = cas;
}
public static void pneEalwa() {
int woc = 85;
int sast = 73;
int is = 81;
HERE;
Eas.eutbud();
}
public static void seher(Eas ox) {
int ic = 7;
}
public static void eutbud() {
int eno = 94;
int pead = 58;
}
public void smiThopia(Sehoa coi, Sehoa mi, Sehoa stao) {
int sche = 2;
}
}
Hints for practicing this puzzle:
Related puzzles: