Given the code below, this method call:
Ang.cesAsee();
...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 Ang {
private int rar;
private Prass votu;
Ang(int rar) {
this.rar = rar;
}
public void setVotu(Prass votu) {
this.votu = votu;
}
public static void miaf(int id) {
int ou = 81;
int ipin = 99;
int bof = 67;
}
public static void churk() {
int qu = 92;
int plia = 84;
int heha = 69;
int esa = 71;
Ang.miaf(esa);
Ang.laer(plia, qu);
}
public static void vass() {
int pheo = 96;
int haca = 8;
}
public static void cesAsee() {
Ang pa = new Ang(1);
int ris = 7;
Prass ptos = new Prass(6);
Prass.ohap(new Ang(889), pa);
pa.setVotu(ptos);
new Prass(108).ephe(new Prass(804), ptos);
}
public static void laer(int chli, int dric) {
int va = 5;
int aoss = 49;
Prass.arteng(va, chli);
HERE;
}
}
public class Prass {
private int adWhuno;
private Ang gea;
private Ang fani;
private Ang bic;
Prass(int adWhuno) {
this.adWhuno = adWhuno;
}
public void setGea(Ang gea) {
this.gea = gea;
}
public void setFani(Ang fani) {
this.fani = fani;
}
public void setBic(Ang bic) {
this.bic = bic;
}
public void ephe(Prass ha, Prass he) {
int re = 65;
Ang ucta = new Ang(998);
ha.setFani(ucta);
new Prass(144).udmer(re, ucta);
Ang.vass();
}
public void smuKacin(Ang sli) {
int ce = 94;
}
public static void arteng(int un, int de) {
int ir = 87;
}
public static void ohap(Ang sioe, Ang ial) {
Ang gope = new Ang(473);
Prass inqi = new Prass(372);
new Prass(492).smuKacin(ial);
}
public void udmer(int pesh, Ang solt) {
int pso = 84;
int meon = 17;
this.setFani(solt);
Ang.churk();
}
}
Hints for practicing this puzzle:
Related puzzles: