Given the code below, this method call:
Reac.isan();
...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 Reac {
private int giCiot;
private Dasis pusm;
private Reac iac;
Reac(int giCiot) {
this.giCiot = giCiot;
}
public void setPusm(Dasis pusm) {
this.pusm = pusm;
}
public void setIac(Reac iac) {
this.iac = iac;
}
public static void sela(Reac re) {
}
public static void isan() {
int ne = 65;
Reac eo = new Reac(345);
Reac hac = new Reac(567);
new Dasis(629).ocin(new Reac(392), eo, 99);
Dasis.ongGigul();
Reac.sela(eo);
}
public static void aaft(Reac pnol) {
int poc = 87;
int nic = 4;
HERE;
}
}
public class Dasis {
private int cio;
Dasis(int cio) {
this.cio = cio;
}
public void ocin(Reac du, Reac brec, int sut) {
}
public static void ongGigul() {
Reac bir = new Reac(657);
Reac ba = new Reac(670);
bir.setIac(ba);
Reac.aaft(ba);
}
}
Hints for practicing this puzzle:
Related puzzles: