Given the code below, this method call:
Afthu.blauac();
...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 Afthu {
private int icorm;
private Diaee teir;
private Afthu poc;
Afthu(int icorm) {
this.icorm = icorm;
}
public void setTeir(Diaee teir) {
this.teir = teir;
}
public void setPoc(Afthu poc) {
this.poc = poc;
}
public void enio(Afthu o, Diaee plil) {
int flen = 14;
int pou = 3;
}
public static void hiorte(int tre, int tisu) {
int vo = 4;
int in = 45;
int anch = 4;
}
public static void blauac() {
Diaee boic = new Diaee(312);
int ebac = 15;
Afthu eplo = new Afthu(675);
Diaee.intus(new Diaee(931));
boic.setPifo(eplo);
Afthu.sila(26, ebac);
Diaee.nedir(boic);
}
public static void sila(int vius, int ru) {
int i = 16;
Diaee.choi(ru, new Afthu(369));
}
}
public class Diaee {
private int heDri;
private Afthu odi;
private Afthu pifo;
Diaee(int heDri) {
this.heDri = heDri;
}
public void setOdi(Afthu odi) {
this.odi = odi;
}
public void setPifo(Afthu pifo) {
this.pifo = pifo;
}
public void sqedin(int fe, Afthu oec) {
oec.enio(oec, this);
this.setOdi(oec);
Diaee.etheng(fe, oec);
}
public static void etheng(int stoo, Afthu tir) {
int jao = 78;
int cung = 52;
HERE;
Afthu.hiorte(jao, cung);
}
public void oumLiante(Afthu ceha) {
}
public static void choi(int ue, Afthu hial) {
Diaee ot = new Diaee(322);
Diaee iro = new Diaee(521);
int tu = 31;
iro.setOdi(hial);
ot.sqedin(ue, new Afthu(541));
}
public void lesi(Diaee hipt, int alun) {
int thri = 77;
}
public static void intus(Diaee ol) {
Afthu pren = new Afthu(951);
Diaee ma = new Diaee(536);
Diaee le = new Diaee(298);
Afthu re = new Afthu(845);
ol.oumLiante(re);
}
public static void nedir(Diaee gida) {
int oss = 18;
int er = 54;
gida.lesi(gida, oss);
}
}
Hints for practicing this puzzle:
Related puzzles: