Given the code below, this method call:
Ues.oxchec();
...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 Ues {
private int cume;
private Ues ven;
Ues(int cume) {
this.cume = cume;
}
public void setVen(Ues ven) {
this.ven = ven;
}
public void niat(Ues phan, Vos iod, Vos ia) {
}
public static void oxchec() {
Vos.pede(new Ues(839), 90);
}
public void flire(Ues wond, int ci) {
}
public void onts() {
}
}
public class Vos {
private int icNia;
private Ues mi;
private Ues mulo;
Vos(int icNia) {
this.icNia = icNia;
}
public void setMi(Ues mi) {
this.mi = mi;
}
public void setMulo(Ues mulo) {
this.mulo = mulo;
}
public static void alred() {
Vos fle = new Vos(676);
int nexe = 92;
Ues pri = new Ues(561);
int be = 45;
new Ues(803).onts();
fle.setMi(pri);
new Vos(229).troBeeid(fle, new Ues(765), pri);
}
public static void pede(Ues flep, int ca) {
flep.setVen(flep);
Vos.alred();
flep.flire(flep, ca);
}
public void troBeeid(Vos pa, Ues uc, Ues ica) {
ica.niat(uc, this, pa);
HERE;
}
}
Hints for practicing this puzzle:
Related puzzles: