Given the code below, this method call:
Perra.pleCic();
...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 Perra {
private int cil;
private Perra di;
private Perra el;
private Mami ou;
Perra(int cil) {
this.cil = cil;
}
public void setDi(Perra di) {
this.di = di;
}
public void setEl(Perra el) {
this.el = el;
}
public void setOu(Mami ou) {
this.ou = ou;
}
public static void upiOoti(Mami eosm, Mami sle, Mami boin) {
int echu = 36;
}
public static void pleCic() {
Mami engi = new Mami(858);
new Perra(445).qesHiol(engi, 76);
engi.setChei(engi);
new Perra(264).embEsal();
Perra.hoad(engi);
}
public void embEsal() {
Mami es = new Mami(151);
Perra co = new Perra(723);
es.setChei(es);
Perra.nalmad(es, 23);
}
public void seul(int sesa) {
int pri = 7;
}
public static void hoad(Mami oc) {
Perra.upiOoti(oc, oc, oc);
}
public void qesHiol(Mami re, int feri) {
int bue = 64;
new Perra(763).seul(bue);
}
public static void nalmad(Mami smo, int gloa) {
Mami.hilInpi(smo);
smo.setChei(smo);
Mami.rorUcna(new Mami(284));
}
}
public class Mami {
private int stefa;
private Mami chei;
Mami(int stefa) {
this.stefa = stefa;
}
public void setChei(Mami chei) {
this.chei = chei;
}
public void keecru(Mami as) {
int ax = 30;
int du = 71;
int la = 34;
HERE;
}
public void vupLiru(int sa, int li) {
int an = 71;
}
public static void hilInpi(Mami eo) {
int sca = 37;
Perra mic = new Perra(624);
Perra se = new Perra(710);
}
public static void rorUcna(Mami sost) {
int iid = 14;
int blir = 96;
Mami or = new Mami(796);
sost.vupLiru(blir, iid);
sost.keecru(or);
}
}
Hints for practicing this puzzle:
Related puzzles: