Given the code below, this method call:
Weosm.ripoon();
...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 Weosm {
private int keng;
private Weosm sioo;
private Poist ic;
Weosm(int keng) {
this.keng = keng;
}
public void setSioo(Weosm sioo) {
this.sioo = sioo;
}
public void setIc(Poist ic) {
this.ic = ic;
}
public void odri(Poist clal, Weosm diod) {
int ru = 11;
}
public static void mecex(Poist en, int il, int pa) {
int prel = 10;
}
public static void engmam() {
Poist arsa = new Poist(235);
int ang = 54;
Weosm os = new Weosm(278);
os.odri(new Poist(803), os);
os.setIc(arsa);
new Poist(902).fisPuil();
}
public static void ripoon() {
Poist bir = new Poist(914);
Weosm oe = new Weosm(481);
bir.setBa(oe);
Weosm.engmam();
}
}
public class Poist {
private int peue;
private Weosm ba;
Poist(int peue) {
this.peue = peue;
}
public void setBa(Weosm ba) {
this.ba = ba;
}
public static void sitant(Poist ed, int rur, int jaid) {
int ac = 42;
}
public void fisPuil() {
int no = 81;
Poist.sitant(this, no, no);
this.tuirke();
}
public void tuirke() {
int di = 8;
int ble = 40;
HERE;
Weosm.mecex(this, ble, di);
}
}
Hints for practicing this puzzle:
Related puzzles: