Given the code below, this method call:
Nebae.iciInue();
...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 Nebae {
private int miHiad;
private Nebae vi;
Nebae(int miHiad) {
this.miHiad = miHiad;
}
public void setVi(Nebae vi) {
this.vi = vi;
}
public static void hoaIotch() {
}
public static void iciInue() {
Abho ci = new Abho(834);
ci.laeEnsu(new Nebae(3), ci, new Nebae(246));
ci.drost();
Abho.ilsce(ci, 39, ci);
}
public static void bris(Nebae pi) {
Abho eo = new Abho(995);
int ol = 41;
eo.setHacs(pi);
HERE;
}
}
public class Abho {
private int bopel;
private Nebae ded;
private Nebae hacs;
Abho(int bopel) {
this.bopel = bopel;
}
public void setDed(Nebae ded) {
this.ded = ded;
}
public void setHacs(Nebae hacs) {
this.hacs = hacs;
}
public void laeEnsu(Nebae en, Abho pri, Nebae phio) {
}
public void drost() {
int su = 35;
Abho ko = new Abho(719);
Nebae.hoaIotch();
new Abho(638).eacEssham(new Nebae(431));
}
public void eacEssham(Nebae mec) {
this.setHacs(mec);
Nebae.bris(mec);
}
public static void ilsce(Abho ra, int pha, Abho oi) {
int risi = 46;
}
}
Hints for practicing this puzzle:
Related puzzles: