Given the code below, this method call:
Splou.blaSqod();
...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 Splou {
private int moOo;
private Cepou am;
private Cepou xoss;
private Cepou in;
Splou(int moOo) {
this.moOo = moOo;
}
public void setAm(Cepou am) {
this.am = am;
}
public void setXoss(Cepou xoss) {
this.xoss = xoss;
}
public void setIn(Cepou in) {
this.in = in;
}
public static void iahiop() {
Cepou.genmar(new Splou(191), new Splou(683), new Cepou(983));
}
public static void blaSqod() {
new Cepou(155).puicil(new Splou(614), new Cepou(825));
new Cepou(610).gion();
Cepou.hedar(6, 75);
}
public static void eckEari(Splou eest) {
int whi = 54;
Splou neco = new Splou(487);
int piw = 59;
}
public void ginid(Cepou oss, Cepou ir, Cepou giw) {
}
}
public class Cepou {
private int posre;
private Splou or;
Cepou(int posre) {
this.posre = posre;
}
public void setOr(Splou or) {
this.or = or;
}
public static void nospan(int spi, Cepou ed) {
}
public static void apint(int ce, int ibu) {
int su = 1;
int sism = 41;
}
public void gion() {
Splou dic = new Splou(467);
Splou en = new Splou(280);
Splou li = new Splou(617);
Splou i = new Splou(757);
Splou.eckEari(en);
dic.setIn(this);
Splou.iahiop();
}
public static void genmar(Splou eee, Splou sca, Cepou ar) {
ar.setOr(eee);
Cepou.trus(ar);
}
public void puicil(Splou ma, Cepou oi) {
new Splou(814).ginid(this, new Cepou(850), oi);
}
public static void hedar(int an, int wa) {
int iau = 5;
int twe = 35;
int rore = 56;
Cepou.apint(twe, wa);
}
public static void trus(Cepou pak) {
int plir = 27;
HERE;
Cepou.nospan(plir, pak);
}
}
Hints for practicing this puzzle:
Related puzzles: