Given the code below, this method call:
Vem.iglel();
...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 Vem {
private int leIu;
private Cluio ress;
private Vem opel;
Vem(int leIu) {
this.leIu = leIu;
}
public void setRess(Cluio ress) {
this.ress = ress;
}
public void setOpel(Vem opel) {
this.opel = opel;
}
public void isto(Vem fel) {
int me = 68;
Cluio cada = new Cluio(237);
}
public static void iben() {
Vem di = new Vem(335);
Cluio rou = new Cluio(110);
new Vem(401).isto(new Vem(149));
rou.setIe(di);
new Cluio(842).phaunu(new Vem(550), di);
}
public static void stuma(Vem pec, Cluio ernu) {
}
public static void iglel() {
Vem.iben();
}
}
public class Cluio {
private int lon;
private Vem ie;
Cluio(int lon) {
this.lon = lon;
}
public void setIe(Vem ie) {
this.ie = ie;
}
public void phaunu(Vem eace, Vem pi) {
int gui = 3;
new Cluio(260).stro(pi, new Vem(205), gui);
eace.setOpel(pi);
this.treca(76);
Vem.stuma(pi, this);
}
public void stro(Vem trie, Vem sest, int oci) {
}
public void treca(int ur) {
Cluio ad = new Cluio(877);
HERE;
}
}
Hints for practicing this puzzle:
Related puzzles: