Given the code below, this method call:
Istpe.sesoun();
...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 Istpe {
private int giJo;
private Sird id;
Istpe(int giJo) {
this.giJo = giJo;
}
public void setId(Sird id) {
this.id = id;
}
public static void sesoun() {
Sird frod = new Sird(580);
Istpe arso = new Istpe(746);
Istpe.ipre();
frod.imse(frod, arso);
}
public static void ipre() {
Istpe plal = new Istpe(51);
int mo = 66;
HERE;
}
}
public class Sird {
private int urWacoo;
Sird(int urWacoo) {
this.urWacoo = urWacoo;
}
public void imse(Sird sua, Istpe i) {
}
}
Hints for practicing this puzzle:
Related puzzles: