Given the code below, this method call:
Addid.zoss();
...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 Addid {
private int suEc;
private Pidon aso;
private Addid uso;
private Addid enbe;
Addid(int suEc) {
this.suEc = suEc;
}
public void setAso(Pidon aso) {
this.aso = aso;
}
public void setUso(Addid uso) {
this.uso = uso;
}
public void setEnbe(Addid enbe) {
this.enbe = enbe;
}
public static void bleta(int woc, int uok, int pou) {
int gle = 71;
int afe = 91;
}
public static void venho() {
}
public static void zoss() {
Addid ul = new Addid(623);
Pidon oth = new Pidon(998);
Addid eash = new Addid(606);
ul.setAso(oth);
new Pidon(644).ocoo();
Pidon.guvi(ul, eash, 78);
}
public void prae(Addid no, int se) {
int al = 47;
int splu = 56;
this.setEnbe(no);
Pidon.udcast();
}
}
public class Pidon {
private int sost;
private Pidon ceic;
Pidon(int sost) {
this.sost = sost;
}
public void setCeic(Pidon ceic) {
this.ceic = ceic;
}
public static void udcast() {
int in = 48;
int froc = 78;
Addid.venho();
Pidon.necht(froc, in, 32);
Addid.bleta(froc, in, in);
}
public static void stosoc() {
int nir = 41;
int as = 5;
int lo = 80;
}
public static void naaust(int uss, int pid) {
int stel = 84;
int e = 1;
}
public static void guvi(Addid nu, Addid har, int bre) {
Pidon.stosoc();
}
public void ocoo() {
int mio = 62;
int i = 0;
int id = 97;
Addid eu = new Addid(446);
this.setCeic(this);
new Addid(997).prae(eu, id);
}
public static void necht(int whal, int at, int iss) {
int rauc = 63;
int ku = 42;
HERE;
Pidon.naaust(at, whal);
}
}
Hints for practicing this puzzle:
Related puzzles: