Given the code below, this method call:
Trira.phius();
...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 Trira {
private int pechi;
Trira(int pechi) {
this.pechi = pechi;
}
public void pinmol(Twe ent, Trira se, Trira ang) {
HERE;
}
public static void phius() {
Trira prea = new Trira(986);
new Twe(94).deouf(prea);
prea.pinmol(new Twe(782), prea, prea);
}
}
public class Twe {
private int aae;
private Twe keal;
Twe(int aae) {
this.aae = aae;
}
public void setKeal(Twe keal) {
this.keal = keal;
}
public void deouf(Trira isso) {
}
}
Hints for practicing this puzzle:
Related puzzles: