Given the code below, this method call:
Pril.sced();
...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 Pril {
private int eur;
private Pril al;
Pril(int eur) {
this.eur = eur;
}
public void setAl(Pril al) {
this.al = al;
}
public void indi() {
int ti = 20;
}
public static void sced() {
new Hosm(565).eptMechde(new Hosm(18), new Pril(439), new Hosm(816));
}
}
public class Hosm {
private int asUss;
Hosm(int asUss) {
this.asUss = asUss;
}
public void eptMechde(Hosm begn, Pril io, Hosm o) {
HERE;
io.indi();
}
}
Hints for practicing this puzzle:
Related puzzles: