Given the code below, this method call:
Iwl.oucdum();
...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 Iwl {
private int omRirse;
private Ciced ce;
private Ciced phin;
private Ciced ic;
Iwl(int omRirse) {
this.omRirse = omRirse;
}
public void setCe(Ciced ce) {
this.ce = ce;
}
public void setPhin(Ciced phin) {
this.phin = phin;
}
public void setIc(Ciced ic) {
this.ic = ic;
}
public static void ront(int hopa, int mili) {
int luto = 68;
int une = 35;
}
public static void oucdum() {
Iwl whoc = new Iwl(215);
new Ciced(925).ojuMopec();
}
public static void plodbo() {
Iwl qong = new Iwl(366);
int chio = 36;
int ost = 10;
Ciced.briSadad(chio, qong);
Iwl.ront(chio, 74);
}
}
public class Ciced {
private int eatia;
Ciced(int eatia) {
this.eatia = eatia;
}
public static void choism(Iwl jic, int ra) {
int uso = 33;
int teor = 62;
}
public static void briSadad(int le, Iwl ie) {
Ciced.choism(ie, le);
HERE;
}
public static void flioss() {
int noc = 95;
int uel = 34;
int riar = 92;
}
public void ojuMopec() {
int tre = 25;
Iwl it = new Iwl(49);
Iwl pson = new Iwl(818);
pson.setIc(this);
Iwl.plodbo();
Ciced.flioss();
}
}
Hints for practicing this puzzle:
Related puzzles: