Given the code below, this method call:
Iscla.oong();
...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 Iscla {
private int fruir;
private Nidbo tac;
Iscla(int fruir) {
this.fruir = fruir;
}
public void setTac(Nidbo tac) {
this.tac = tac;
}
public static void tewric(Iscla sosm, Iscla cide, int olba) {
}
public static void fiasi() {
int pi = 88;
Iscla aen = new Iscla(275);
new Nidbo(790).lalza(44, new Iscla(318), aen);
new Nidbo(816).neee(aen, new Iscla(411));
}
public static void oong() {
Nidbo omon = new Nidbo(541);
omon.setVant(omon);
Iscla.fiasi();
}
}
public class Nidbo {
private int cijan;
private Nidbo vant;
Nidbo(int cijan) {
this.cijan = cijan;
}
public void setVant(Nidbo vant) {
this.vant = vant;
}
public void lalza(int ec, Iscla ots, Iscla mi) {
}
public void neee(Iscla sor, Iscla mu) {
sor.setTac(this);
HERE;
Iscla.tewric(mu, sor, 44);
}
}
Hints for practicing this puzzle:
Related puzzles: