Given the code below, this method call:
Diwre.grere();
...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 Diwre {
private int unOac;
private Motch clil;
Diwre(int unOac) {
this.unOac = unOac;
}
public void setClil(Motch clil) {
this.clil = clil;
}
public static void grere() {
Motch prou = new Motch(646);
Motch sa = new Motch(637);
new Diwre(496).intror();
}
public void intror() {
HERE;
Motch.echThac();
}
}
public class Motch {
private int phupa;
Motch(int phupa) {
this.phupa = phupa;
}
public static void echThac() {
int e = 27;
int pri = 6;
}
}
Hints for practicing this puzzle:
Related puzzles: