Given the code below, this method call:
Oci.biowl();
...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 Oci {
private int tedea;
Oci(int tedea) {
this.tedea = tedea;
}
public void leend() {
int ep = 80;
Oci.seloe(ep, this, ep);
this.ooeBodi(this, 67, ep);
Isti.peves(this, ep, ep);
}
public void walRerm() {
int se = 99;
int oun = 24;
int bla = 48;
}
public void ooeBodi(Oci hi, int o, int ed) {
Oci.driss(hi);
hi.walRerm();
}
public void brai(int kort) {
HERE;
}
public static void biowl() {
Isti deel = new Isti(423);
Isti cu = new Isti(482);
Isti prel = new Isti(693);
Oci eaci = new Oci(255);
Isti im = new Isti(738);
cu.setCecu(prel);
new Oci(621).leend();
}
public static void seloe(int ge, Oci balo, int ce) {
}
public static void driss(Oci ruph) {
int es = 99;
int bu = 42;
int i = 91;
int ui = 93;
ruph.brai(ui);
Isti.hecPhra(ruph, i, ui);
}
}
public class Isti {
private int viSodo;
private Isti ue;
private Isti cecu;
private Isti mi;
private Isti enec;
Isti(int viSodo) {
this.viSodo = viSodo;
}
public void setUe(Isti ue) {
this.ue = ue;
}
public void setCecu(Isti cecu) {
this.cecu = cecu;
}
public void setMi(Isti mi) {
this.mi = mi;
}
public void setEnec(Isti enec) {
this.enec = enec;
}
public static void peves(Oci saso, int igur, int il) {
}
public static void hecPhra(Oci raso, int na, int e) {
}
}
Hints for practicing this puzzle:
Related puzzles: