Given the code below, this method call:
Ekis.nelProess();
...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 Ekis {
private int cazin;
private Ekis fiss;
private Ciblu riio;
Ekis(int cazin) {
this.cazin = cazin;
}
public void setFiss(Ekis fiss) {
this.fiss = fiss;
}
public void setRiio(Ciblu riio) {
this.riio = riio;
}
public static void tengme(Ekis ad, Ciblu pi) {
}
public static void nelProess() {
Ekis o = new Ekis(905);
Ekis biou = new Ekis(972);
int hi = 34;
Ciblu fong = new Ciblu(618);
Ekis.trose(o, biou, 35);
o.setFiss(biou);
Ciblu.qetAwul(biou);
Ekis.tengme(biou, fong);
}
public void vuned() {
this.magon(this);
}
public static void trose(Ekis seda, Ekis acec, int hai) {
}
public void magon(Ekis od) {
int en = 80;
HERE;
od.hicmad(new Ekis(782), od, 80);
}
public void hicmad(Ekis cuc, Ekis osm, int kel) {
}
}
public class Ciblu {
private int esHe;
private Ekis odar;
Ciblu(int esHe) {
this.esHe = esHe;
}
public void setOdar(Ekis odar) {
this.odar = odar;
}
public static void qetAwul(Ekis da) {
int jaur = 88;
Ciblu tus = new Ciblu(163);
tus.setOdar(da);
da.vuned();
}
}
Hints for practicing this puzzle:
Related puzzles: