Given the code below, this method call:
Encil.vass();
...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 Encil {
private int cirm;
private Encil ce;
private Encil iss;
Encil(int cirm) {
this.cirm = cirm;
}
public void setCe(Encil ce) {
this.ce = ce;
}
public void setIss(Encil iss) {
this.iss = iss;
}
public static void madsad(Podso au, Podso nish, Podso oe) {
int ad = 18;
int hess = 6;
}
public static void mapac(Podso plas) {
Encil ufe = new Encil(47);
Podso ceng = new Podso(605);
Encil vicu = new Encil(182);
}
public static void vass() {
Podso ja = new Podso(631);
Podso dant = new Podso(615);
Encil.ceicat();
dant.setWhon(ja);
ja.iwkont();
Encil.atha(dant, ja);
}
public void nowhul() {
Encil.mapac(new Podso(572));
Podso.krart(this);
}
public void pasm(int fo, int asm, int qo) {
Encil sul = new Encil(558);
sul.setCe(this);
new Encil(933).nowhul();
}
public static void ceicat() {
Podso e = new Podso(904);
Encil a = new Encil(733);
Encil ir = new Encil(71);
int glou = 39;
new Podso(595).epeCocaic(ir, a);
}
public static void atha(Podso hai, Podso eear) {
Encil.madsad(eear, hai, eear);
}
}
public class Podso {
private int sape;
private Podso whon;
private Podso ewn;
Podso(int sape) {
this.sape = sape;
}
public void setWhon(Podso whon) {
this.whon = whon;
}
public void setEwn(Podso ewn) {
this.ewn = ewn;
}
public static void krart(Encil glan) {
Encil cas = new Encil(434);
int es = 36;
int uan = 23;
int vo = 3;
Podso.medcio(uan);
HERE;
}
public void iwkont() {
int cinu = 95;
int stru = 44;
int sor = 0;
this.setEwn(this);
new Encil(647).pasm(sor, cinu, stru);
}
public static void medcio(int mec) {
int psa = 12;
int imen = 98;
}
public void epeCocaic(Encil si, Encil ta) {
Podso enbu = new Podso(743);
int da = 56;
}
}
Hints for practicing this puzzle:
Related puzzles: