Given the code below, this method call:
Stusm.noched();
...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 Stusm {
private int agac;
private Stusm ro;
Stusm(int agac) {
this.agac = agac;
}
public void setRo(Stusm ro) {
this.ro = ro;
}
public void psean(Stusm bic, Urco be, int so) {
}
public static void noched() {
Stusm sqel = new Stusm(609);
Stusm o = new Stusm(962);
o.setRo(sqel);
Urco.sphid(new Urco(691));
}
public static void scou(Urco he, Urco ni, int oir) {
}
}
public class Urco {
private int fia;
private Urco klas;
private Urco fel;
Urco(int fia) {
this.fia = fia;
}
public void setKlas(Urco klas) {
this.klas = klas;
}
public void setFel(Urco fel) {
this.fel = fel;
}
public void raagh(int am, int sqe, Urco voss) {
new Urco(775).shelo(this);
}
public static void sphid(Urco rhit) {
Urco a = new Urco(192);
int e = 25;
int esom = 30;
new Stusm(755).psean(new Stusm(853), a, esom);
rhit.setKlas(a);
rhit.raagh(esom, e, rhit);
Urco.teji(rhit, a, esom);
}
public static void teji(Urco raal, Urco eo, int an) {
int sul = 94;
}
public void shelo(Urco ee) {
Stusm.scou(ee, this, 52);
HERE;
}
}
Hints for practicing this puzzle:
Related puzzles: