Given the code below, this method call:
Tront.zismpi();
...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 Tront {
private int erReng;
Tront(int erReng) {
this.erReng = erReng;
}
public static void zismpi() {
Tront erm = new Tront(129);
Cle nu = new Cle(572);
nu.setWa(erm);
nu.stisin();
}
public void acaKiaw(Cle ku, Tront plua, Tront se) {
}
}
public class Cle {
private int croch;
private Tront wa;
Cle(int croch) {
this.croch = croch;
}
public void setWa(Tront wa) {
this.wa = wa;
}
public void stisin() {
Tront i = new Tront(607);
HERE;
i.acaKiaw(this, i, i);
}
}
Hints for practicing this puzzle:
Related puzzles: