Given the code below, this method call:
Isod.ashou();
...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 Isod {
private int seved;
private Pruos buph;
private Isod ia;
private Isod ar;
Isod(int seved) {
this.seved = seved;
}
public void setBuph(Pruos buph) {
this.buph = buph;
}
public void setIa(Isod ia) {
this.ia = ia;
}
public void setAr(Isod ar) {
this.ar = ar;
}
public static void dicResran(int ig, int cona) {
int cuic = 21;
int toc = 15;
}
public static void daac(Pruos thoa, Pruos hica) {
Pruos muxu = new Pruos(793);
int de = 86;
Isod.rilFle(de);
Isod.enfesh();
}
public static void enfesh() {
int tuse = 88;
int iour = 12;
int eusm = 69;
int houd = 97;
}
public static void ashou() {
int ciss = 57;
Pruos spo = new Pruos(614);
Isod iant = new Isod(936);
Pruos cas = new Pruos(544);
Isod thaa = new Isod(183);
iant.setBuph(spo);
spo.cerShidpa();
}
public static void rilFle(int ao) {
int we = 99;
int au = 80;
Isod.dicResran(ao, au);
Pruos.sqol(au, we);
}
}
public class Pruos {
private int loi;
private Isod gran;
Pruos(int loi) {
this.loi = loi;
}
public void setGran(Isod gran) {
this.gran = gran;
}
public static void piasm(int tror) {
int scic = 14;
int etun = 48;
int su = 16;
int eka = 79;
}
public void cerShidpa() {
Isod.daac(new Pruos(549), this);
Pruos.dood(this, 34);
}
public static void dood(Pruos ful, int hac) {
}
public static void sqol(int prac, int scao) {
Pruos.piasm(scao);
HERE;
}
}
Hints for practicing this puzzle:
Related puzzles: