Given the code below, this method call:
Hetch.laght();
...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 Hetch {
private int asmpe;
private Hetch mec;
private Hetch tefo;
Hetch(int asmpe) {
this.asmpe = asmpe;
}
public void setMec(Hetch mec) {
this.mec = mec;
}
public void setTefo(Hetch tefo) {
this.tefo = tefo;
}
public static void ciras() {
Wenme mi = new Wenme(576);
}
public static void odess(int ce, Hetch da) {
int rean = 98;
da.setMec(da);
Wenme.eescec(rean, da, ce);
Wenme.krid(da, rean);
}
public void grupes(Wenme shus, Hetch se) {
int sti = 90;
Wenme.douash(shus, this);
}
public void chasil() {
Hetch mema = new Hetch(484);
int alil = 95;
int ongo = 22;
mema.setTefo(this);
Hetch.odess(alil, mema);
Hetch.angdun();
}
public static void laght() {
Wenme bla = new Wenme(370);
Wenme hisa = new Wenme(24);
Hetch iro = new Hetch(356);
Wenme masm = new Wenme(523);
int ong = 31;
hisa.pelMeaght(new Hetch(47), ong, masm);
bla.setSoio(masm);
new Hetch(185).chasil();
iro.grupes(bla, iro);
}
public static void angdun() {
int gler = 41;
int nild = 47;
int stah = 91;
int haso = 69;
}
}
public class Wenme {
private int odfal;
private Hetch ed;
private Wenme soio;
Wenme(int odfal) {
this.odfal = odfal;
}
public void setEd(Hetch ed) {
this.ed = ed;
}
public void setSoio(Wenme soio) {
this.soio = soio;
}
public static void eescec(int smil, Hetch fi, int cin) {
int ol = 1;
Wenme.idin(smil, fi);
}
public static void idin(int zeac, Hetch i) {
int nudu = 93;
HERE;
}
public static void douash(Wenme radi, Hetch stel) {
}
public void pelMeaght(Hetch cu, int weac, Wenme ac) {
Hetch.ciras();
}
public static void krid(Hetch tris, int on) {
}
}
Hints for practicing this puzzle:
Related puzzles: