Given the code below, this method call:
Douec.mouwk();
...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 Douec {
private int hiSwue;
Douec(int hiSwue) {
this.hiSwue = hiSwue;
}
public static void amdi() {
Ael va = new Ael(517);
}
public static void mouwk() {
Douec nu = new Douec(959);
Douec.amdi();
Ael.mocce(nu, new Douec(284), nu);
}
}
public class Ael {
private int eba;
private Ael tiad;
Ael(int eba) {
this.eba = eba;
}
public void setTiad(Ael tiad) {
this.tiad = tiad;
}
public static void mocce(Douec trar, Douec an, Douec doin) {
HERE;
}
}
Hints for practicing this puzzle:
Related puzzles: