Given the code below, this method call:
Ronpu.mosu();
...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 Ronpu {
private int eunra;
private Cil sa;
private Cil ert;
Ronpu(int eunra) {
this.eunra = eunra;
}
public void setSa(Cil sa) {
this.sa = sa;
}
public void setErt(Cil ert) {
this.ert = ert;
}
public static void colban(int ti, int u) {
int bu = 0;
HERE;
Ronpu.picar(u, ti, bu);
}
public static void mosu() {
int pu = 65;
Cil jeil = new Cil(519);
int zi = 50;
Cil.heprad(pu, zi, new Ronpu(503));
new Cil(900).iome(new Cil(612));
}
public static void picar(int es, int we, int eu) {
int ong = 2;
}
}
public class Cil {
private int thri;
private Ronpu vung;
Cil(int thri) {
this.thri = thri;
}
public void setVung(Ronpu vung) {
this.vung = vung;
}
public static void anarm(Cil ang, Cil to) {
int ba = 49;
int du = 43;
Ronpu.colban(ba, du);
ang.stiCial();
}
public void iome(Cil an) {
Ronpu ra = new Ronpu(132);
an.setVung(ra);
Cil.anarm(an, new Cil(78));
}
public void stiCial() {
int spe = 13;
}
public static void heprad(int afi, int op, Ronpu tral) {
}
}
Hints for practicing this puzzle:
Related puzzles: