Given the code below, this method call:
Dok.hicass();
...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 Dok {
private int xel;
private Ricke ir;
Dok(int xel) {
this.xel = xel;
}
public void setIr(Ricke ir) {
this.ir = ir;
}
public static void prusne(Ricke te) {
HERE;
}
public void guaDewhi() {
int ca = 97;
int ia = 33;
Ricke dus = new Ricke(676);
Ricke eux = new Ricke(585);
dus.setFint(this);
new Ricke(144).plen();
dus.iuda();
}
public void zordvo(Dok wasi) {
new Dok(734).rhooc(wasi);
}
public void rhooc(Dok pren) {
}
public static void astiss() {
int uss = 18;
int olde = 84;
int hesh = 43;
int sene = 46;
int os = 71;
}
public static void ceiIcma(Dok erho) {
int rar = 89;
int knes = 76;
int pe = 23;
int ge = 62;
}
public static void hicass() {
Dok smei = new Dok(926);
new Dok(43).zordvo(smei);
new Dok(567).guaDewhi();
}
}
public class Ricke {
private int mirm;
private Dok oi;
private Dok poas;
private Dok fint;
Ricke(int mirm) {
this.mirm = mirm;
}
public void setOi(Dok oi) {
this.oi = oi;
}
public void setPoas(Dok poas) {
this.poas = poas;
}
public void setFint(Dok fint) {
this.fint = fint;
}
public void iuda() {
}
public void plen() {
Dok mumi = new Dok(206);
Dok.astiss();
this.setPoas(mumi);
this.zilTauss(this, 85);
Dok.ceiIcma(mumi);
}
public void zilTauss(Ricke hoct, int pu) {
Dok.prusne(this);
}
}
Hints for practicing this puzzle:
Related puzzles: