Given the code below, this method call:
Fis.parar();
...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 Fis {
private int clui;
private Eerd qun;
private Fis qa;
private Fis cour;
Fis(int clui) {
this.clui = clui;
}
public void setQun(Eerd qun) {
this.qun = qun;
}
public void setQa(Fis qa) {
this.qa = qa;
}
public void setCour(Fis cour) {
this.cour = cour;
}
public static void snak() {
Fis ce = new Fis(405);
Fis nior = new Fis(24);
int sa = 6;
int uss = 22;
Eerd.coish();
ce.setCour(nior);
HERE;
Fis.sioa(ce);
}
public static void parar() {
Fis.tiouco();
new Eerd(0).xiosm();
Fis.ruce();
}
public static void tiouco() {
Fis qead = new Fis(247);
Eerd aplo = new Eerd(534);
Fis po = new Fis(975);
int mori = 22;
Eerd ild = new Eerd(717);
ild.mecme(mori);
}
public static void ruce() {
int bire = 36;
int ong = 45;
Eerd.skia(ong);
}
public static void sioa(Fis li) {
int wie = 70;
int ial = 62;
}
}
public class Eerd {
private int chel;
private Fis pehu;
Eerd(int chel) {
this.chel = chel;
}
public void setPehu(Fis pehu) {
this.pehu = pehu;
}
public static void coish() {
int it = 83;
int doi = 6;
int pren = 53;
}
public static void skia(int opra) {
int bre = 72;
int ta = 53;
}
public void onis(int oo, Eerd cren) {
Eerd.oprec(oo, new Eerd(534), cren);
}
public static void oprec(int wec, Eerd pra, Eerd or) {
int da = 56;
Fis.snak();
}
public void xiosm() {
Eerd er = new Eerd(135);
Fis nase = new Fis(745);
nase.setQun(er);
this.onis(72, this);
}
public void mecme(int co) {
}
}
Hints for practicing this puzzle:
Related puzzles: