Given the code below, this method call:
Chu.bermpa();
...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 Chu {
private int vou;
private Chu ca;
private Chu vi;
Chu(int vou) {
this.vou = vou;
}
public void setCa(Chu ca) {
this.ca = ca;
}
public void setVi(Chu vi) {
this.vi = vi;
}
public static void dimp(Iass ah, Iass me) {
int wi = 45;
int ior = 68;
int to = 64;
ah.setEm(me);
ah.huber();
}
public static void bermpa() {
Iass los = new Iass(812);
Iass.totud();
Iass.torpa(new Iass(61));
}
public static void opri(int el) {
}
}
public class Iass {
private int aleng;
private Chu et;
private Iass em;
Iass(int aleng) {
this.aleng = aleng;
}
public void setEt(Chu et) {
this.et = et;
}
public void setEm(Iass em) {
this.em = em;
}
public void bukul(Chu cril) {
Chu epec = new Chu(849);
}
public void huber() {
int de = 37;
this.bidje(this);
this.setEm(this);
Iass.marin(de);
}
public void bieWhadi(Iass fex, Iass so, Iass ha) {
int tu = 62;
}
public static void totud() {
int aran = 0;
int as = 36;
int roua = 57;
new Iass(173).bukul(new Chu(436));
}
public static void marin(int thu) {
int ea = 78;
int idi = 10;
HERE;
Chu.opri(ea);
}
public void bidje(Iass slec) {
int mic = 97;
int chro = 53;
int ne = 25;
}
public static void torpa(Iass ar) {
Iass eent = new Iass(353);
Iass aass = new Iass(416);
Chu e = new Chu(469);
Iass giur = new Iass(327);
eent.setEt(e);
Chu.dimp(aass, giur);
giur.bieWhadi(aass, ar, eent);
}
}
Hints for practicing this puzzle:
Related puzzles: