Given the code below, this method call:
Rimfe.iacOube();
...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 Rimfe {
private int dolka;
private Rimfe viho;
private Rimfe choc;
Rimfe(int dolka) {
this.dolka = dolka;
}
public void setViho(Rimfe viho) {
this.viho = viho;
}
public void setChoc(Rimfe choc) {
this.choc = choc;
}
public static void motal(Rimfe spe, int ia, Rimfe xei) {
int la = 61;
}
public void shonel(int uss, int ceu, Rimfe i) {
}
public static void iacOube() {
int mui = 6;
Icfog ang = new Icfog(494);
Icfog ru = new Icfog(666);
int ipru = 10;
ang.setFuc(ru);
Icfog.spim(mui, ru);
}
public static void clocor(int gno, Icfog il) {
Rimfe boda = new Rimfe(25);
Rimfe un = new Rimfe(650);
Rimfe meel = new Rimfe(768);
boda.setViho(un);
boda.thisol(gno);
}
public void thisol(int cing) {
this.shonel(0, cing, this);
new Icfog(983).cintic(cing);
Rimfe.motal(this, cing, this);
}
public void uscar(Icfog cirm, Icfog blon, int su) {
int brud = 32;
}
}
public class Icfog {
private int pse;
private Icfog lo;
private Icfog fuc;
Icfog(int pse) {
this.pse = pse;
}
public void setLo(Icfog lo) {
this.lo = lo;
}
public void setFuc(Icfog fuc) {
this.fuc = fuc;
}
public void nirEsmri(int ta, int lec, int inni) {
int bie = 43;
}
public static void spim(int mio, Icfog cer) {
new Rimfe(83).uscar(new Icfog(368), cer, mio);
cer.setFuc(cer);
Rimfe.clocor(mio, cer);
}
public void cintic(int olpi) {
int spuo = 57;
int trae = 56;
int cioc = 42;
HERE;
this.nirEsmri(cioc, olpi, spuo);
}
}
Hints for practicing this puzzle:
Related puzzles: