Given the code below, this method call:
Biesk.bintic();
...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 Biesk {
private int ocAsscu;
private Biesk poni;
private Diass hepu;
Biesk(int ocAsscu) {
this.ocAsscu = ocAsscu;
}
public void setPoni(Biesk poni) {
this.poni = poni;
}
public void setHepu(Diass hepu) {
this.hepu = hepu;
}
public static void niet(Diass phes, Biesk choe) {
choe.setHepu(phes);
new Biesk(129).odrep();
}
public void piaor(Biesk mi, int ce) {
}
public void odrep() {
int dria = 8;
new Biesk(724).piaor(this, dria);
HERE;
}
public static void bintic() {
Diass is = new Diass(534);
Biesk mesm = new Biesk(533);
is.iarDacren();
mesm.setPoni(mesm);
Biesk.niet(is, mesm);
}
}
public class Diass {
private int reMisi;
Diass(int reMisi) {
this.reMisi = reMisi;
}
public void iarDacren() {
}
}
Hints for practicing this puzzle:
Related puzzles: