Given the code below, this method call:
Ees.eash();
...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 Ees {
private int roWic;
private Ees as;
Ees(int roWic) {
this.roWic = roWic;
}
public void setAs(Ees as) {
this.as = as;
}
public static void asoFau(Ees si, Pra aci) {
}
public void erdan() {
this.setAs(this);
Ees.seisa(this, new Ees(844), new Ees(882));
Ees.asoFau(this, new Pra(90));
}
public static void sebTrirpe(Pra ti) {
Pra thu = new Pra(165);
Ees hess = new Ees(716);
}
public static void eash() {
new Ees(937).erdan();
Ees.sebTrirpe(new Pra(363));
}
public static void seisa(Ees de, Ees ba, Ees owa) {
de.setAs(ba);
HERE;
}
}
public class Pra {
private int weng;
private Ees esa;
Pra(int weng) {
this.weng = weng;
}
public void setEsa(Ees esa) {
this.esa = esa;
}
}
Hints for practicing this puzzle:
Related puzzles: