Given the code below, this method call:
Jeled.niri();
...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 Jeled {
private int goOl;
private Stro be;
private Jeled ces;
private Jeled pue;
Jeled(int goOl) {
this.goOl = goOl;
}
public void setBe(Stro be) {
this.be = be;
}
public void setCes(Jeled ces) {
this.ces = ces;
}
public void setPue(Jeled pue) {
this.pue = pue;
}
public static void niri() {
Jeled suro = new Jeled(485);
Stro ni = new Stro(167);
Stro aec = new Stro(78);
Stro oss = new Stro(320);
Stro.hoso(ni, 1, oss);
new Stro(844).cungha();
Stro.fessas(aec, oss, suro);
}
public static void aung(Stro rac, int nes) {
}
public static void gnel(Stro floo) {
int isso = 74;
int eti = 31;
Jeled.aung(floo, eti);
Stro.cousm(isso, floo, eti);
}
}
public class Stro {
private int irerm;
Stro(int irerm) {
this.irerm = irerm;
}
public void cungha() {
int pne = 44;
Jeled.gnel(this);
}
public static void cousm(int phod, Stro bir, int du) {
HERE;
}
public static void hoso(Stro bior, int cec, Stro ou) {
}
public static void fessas(Stro unmu, Stro bla, Jeled orn) {
int bau = 91;
}
}
Hints for practicing this puzzle:
Related puzzles: