Given the code below, this method call:
Aisdi.paresm();
...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 Aisdi {
private int prass;
private Cloi an;
private Cloi ur;
private Cloi meae;
private Aisdi le;
Aisdi(int prass) {
this.prass = prass;
}
public void setAn(Cloi an) {
this.an = an;
}
public void setUr(Cloi ur) {
this.ur = ur;
}
public void setMeae(Cloi meae) {
this.meae = meae;
}
public void setLe(Aisdi le) {
this.le = le;
}
public static void tunch(int lol) {
int eang = 98;
int uosi = 7;
int ui = 57;
int stol = 1;
}
public void tretra(Aisdi si, Aisdi on) {
Aisdi nang = new Aisdi(815);
Aisdi en = new Aisdi(7);
Cloi.shoess(on);
}
public static void paresm() {
Aisdi bi = new Aisdi(735);
new Aisdi(406).tretra(bi, new Aisdi(433));
Cloi.meduss(bi, new Aisdi(594), new Aisdi(973));
}
public static void presm(int ris) {
int ko = 19;
int cac = 66;
int il = 48;
int cer = 85;
}
public static void itor(int e, int gism) {
int epla = 80;
int hil = 78;
Aisdi.tunch(e);
HERE;
}
}
public class Cloi {
private int huc;
Cloi(int huc) {
this.huc = huc;
}
public static void meduss(Aisdi cena, Aisdi pse, Aisdi emb) {
int mul = 25;
Aisdi ble = new Aisdi(96);
Cloi.dicRarpi(pse, mul);
}
public static void shoess(Aisdi rop) {
Aisdi idto = new Aisdi(654);
int ogul = 76;
Cloi ir = new Cloi(422);
}
public void dusoo(Aisdi daca, Cloi ecs) {
int reba = 11;
int eia = 98;
}
public static void dicRarpi(Aisdi thil, int amec) {
Cloi vue = new Cloi(485);
Cloi uze = new Cloi(593);
thil.setAn(vue);
Cloi.tred();
vue.dusoo(thil, uze);
}
public static void tred() {
int qent = 24;
int comi = 73;
Aisdi.itor(qent, comi);
Aisdi.presm(comi);
}
}
Hints for practicing this puzzle:
Related puzzles: