Given the code below, this method call:
Iseae.dentol();
...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 Iseae {
private int sila;
private Iseae guc;
private Iseae atch;
private Issee nuss;
private Issee rhin;
Iseae(int sila) {
this.sila = sila;
}
public void setGuc(Iseae guc) {
this.guc = guc;
}
public void setAtch(Iseae atch) {
this.atch = atch;
}
public void setNuss(Issee nuss) {
this.nuss = nuss;
}
public void setRhin(Issee rhin) {
this.rhin = rhin;
}
public void himen(Iseae ig, int au, int u) {
int la = 5;
this.setGuc(ig);
new Issee(803).miel();
}
public static void dentol() {
int eno = 75;
int iss = 78;
new Iseae(196).raim();
Issee.elhain(eno, iss);
}
public void raim() {
Iseae di = new Iseae(761);
int caee = 89;
int oa = 56;
int lazi = 19;
di.setGuc(this);
di.himen(this, lazi, caee);
}
public void phlou(int pran, Issee sa) {
int ar = 26;
sa.stear(this, pran);
this.setRhin(sa);
HERE;
}
public static void lert() {
int bu = 9;
int rasm = 95;
int esam = 56;
}
public static void hise() {
}
}
public class Issee {
private int tihi;
Issee(int tihi) {
this.tihi = tihi;
}
public void miel() {
int aeag = 99;
Issee ro = new Issee(504);
Issee ces = new Issee(140);
new Issee(328).perpo();
new Iseae(665).phlou(aeag, ro);
Iseae.lert();
}
public static void elhain(int sest, int purm) {
int tanu = 85;
Iseae.hise();
}
public void stear(Iseae od, int eane) {
int esm = 91;
}
public void perpo() {
Iseae ilti = new Iseae(120);
Iseae slia = new Iseae(170);
Iseae be = new Iseae(326);
int al = 39;
}
}
Hints for practicing this puzzle:
Related puzzles: