Given the code below, this method call:
Ipioc.ceic();
...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 Ipioc {
private int popan;
private Netea ome;
Ipioc(int popan) {
this.popan = popan;
}
public void setOme(Netea ome) {
this.ome = ome;
}
public static void ceic() {
Ipioc er = new Ipioc(810);
int gac = 51;
Netea qel = new Netea(578);
new Netea(320).chied();
er.setOme(qel);
qel.spiWulma();
}
public static void freje() {
}
public static void knarch() {
Ipioc on = new Ipioc(923);
Ipioc waut = new Ipioc(330);
}
public static void astol(Netea a) {
Ipioc.knarch();
a.thoc(a, 78, new Netea(948));
}
}
public class Netea {
private int enBi;
private Ipioc ent;
private Netea so;
Netea(int enBi) {
this.enBi = enBi;
}
public void setEnt(Ipioc ent) {
this.ent = ent;
}
public void setSo(Netea so) {
this.so = so;
}
public void spiWulma() {
int dack = 23;
Netea iebe = new Netea(609);
int go = 10;
this.setSo(iebe);
Ipioc.astol(this);
}
public void chied() {
int co = 20;
Netea el = new Netea(735);
}
public void thoc(Netea mi, int phe, Netea et) {
Ipioc.freje();
HERE;
}
}
Hints for practicing this puzzle:
Related puzzles: