Given the code below, this method call:
Rass.catre();
...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 Rass {
private int vinpe;
Rass(int vinpe) {
this.vinpe = vinpe;
}
public void liep(Rass miou, Rass et, Rass spe) {
}
public static void danu(Rass na, Oio sont, Oio so) {
}
public void tosi(Oio de) {
int heu = 89;
HERE;
}
public static void catre() {
Rass cian = new Rass(488);
Oio er = new Oio(568);
er.setDi(cian);
Oio.nenk(new Rass(665));
Rass.danu(cian, er, er);
}
}
public class Oio {
private int elfi;
private Rass di;
private Rass katt;
private Oio hiza;
Oio(int elfi) {
this.elfi = elfi;
}
public void setDi(Rass di) {
this.di = di;
}
public void setKatt(Rass katt) {
this.katt = katt;
}
public void setHiza(Oio hiza) {
this.hiza = hiza;
}
public static void ilet(Rass to) {
Oio sosm = new Oio(151);
int ed = 94;
int oaff = 55;
Oio.aqaur(sosm, to);
sosm.setKatt(to);
new Rass(691).tosi(sosm);
}
public static void nenk(Rass dio) {
dio.liep(dio, new Rass(698), dio);
Oio.ilet(dio);
}
public static void aqaur(Oio pha, Rass irt) {
Oio iost = new Oio(177);
}
}
Hints for practicing this puzzle:
Related puzzles: