Given the code below, this method call:
Aso.hoaria();
...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 Aso {
private int ong;
private Bie uck;
Aso(int ong) {
this.ong = ong;
}
public void setUck(Bie uck) {
this.uck = uck;
}
public static void hoaria() {
Bie ci = new Bie(880);
Aso isel = new Aso(139);
int nal = 92;
ci.setMi(isel);
Aso.beedpo();
}
public static void cathol(Bie se, int du, Aso su) {
}
public void ephru(Aso inri) {
int il = 22;
}
public static void beedpo() {
Bie in = new Bie(78);
Aso tud = new Aso(97);
Bie.oism();
in.setMi(tud);
Bie.gral(tud);
Aso.cathol(in, 39, tud);
}
}
public class Bie {
private int ceEs;
private Bie ipto;
private Aso mi;
Bie(int ceEs) {
this.ceEs = ceEs;
}
public void setIpto(Bie ipto) {
this.ipto = ipto;
}
public void setMi(Aso mi) {
this.mi = mi;
}
public static void oism() {
int el = 2;
Bie vo = new Bie(611);
}
public void hulLaswer() {
int eck = 15;
int sior = 40;
HERE;
}
public static void gral(Aso sqim) {
new Bie(103).hulLaswer();
sqim.ephru(sqim);
}
}
Hints for practicing this puzzle:
Related puzzles: