Given the code below, this method call:
Doder.sefLism();
...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 Doder {
private int rino;
private Blaft edu;
private Doder buc;
Doder(int rino) {
this.rino = rino;
}
public void setEdu(Blaft edu) {
this.edu = edu;
}
public void setBuc(Doder buc) {
this.buc = buc;
}
public static void glano(Doder riol, Blaft uc) {
Blaft.ossSongge(new Blaft(55));
uc.inbos(uc, 81, riol);
}
public static void sefLism() {
Doder ba = new Doder(922);
Blaft phid = new Blaft(587);
Doder.glano(new Doder(137), phid);
Doder.vosCiesh(phid, ba);
}
public static void vosCiesh(Blaft ro, Doder e) {
}
}
public class Blaft {
private int ther;
Blaft(int ther) {
this.ther = ther;
}
public static void ossSongge(Blaft el) {
int io = 33;
int hul = 57;
HERE;
}
public void inbos(Blaft pu, int nic, Doder cing) {
}
}
Hints for practicing this puzzle:
Related puzzles: