Given the code below, this method call:
Dasul.vooBresma();
...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 Dasul {
private int otWimo;
private Dasul ru;
private Dasul is;
private Dasul da;
Dasul(int otWimo) {
this.otWimo = otWimo;
}
public void setRu(Dasul ru) {
this.ru = ru;
}
public void setIs(Dasul is) {
this.is = is;
}
public void setDa(Dasul da) {
this.da = da;
}
public static void avai(Dasul ua, int rean, Deng mai) {
int ul = 9;
Deng.deneph(ul, ua);
mai.ispPlost(mai);
Deng.bluha(ua, rean, ul);
}
public void prarel() {
int bi = 91;
int nela = 51;
int nin = 52;
this.setIs(this);
Dasul.avai(this, bi, new Deng(302));
Deng.blusod(nela, this);
}
public static void vooBresma() {
Dasul icro = new Dasul(882);
Deng oma = new Deng(225);
Dasul ien = new Dasul(842);
ien.setRu(icro);
new Dasul(183).prarel();
}
}
public class Deng {
private int sloar;
Deng(int sloar) {
this.sloar = sloar;
}
public static void deneph(int cemo, Dasul aa) {
int fiec = 53;
}
public void ispPlost(Deng en) {
int epro = 40;
int al = 84;
HERE;
}
public static void blusod(int huc, Dasul elca) {
int ol = 58;
}
public static void bluha(Dasul mic, int orou, int coso) {
}
}
Hints for practicing this puzzle:
Related puzzles: