Given the code below, this method call:
Sios.wipEpross();
...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 Sios {
private int cet;
private Sios us;
Sios(int cet) {
this.cet = cet;
}
public void setUs(Sios us) {
this.us = us;
}
public void prar(int oia, int ud) {
int slan = 11;
}
public void evoBrerma(Unt taek, Sios imin) {
new Sios(749).wobal();
}
public static void wipEpross() {
Sios or = new Sios(395);
or.setUs(or);
or.eciOng(or, new Unt(709));
Unt.spoTheass(or);
}
public void eciOng(Sios e, Unt aa) {
new Unt(219).cingra(e, this, new Unt(966));
aa.setMo(aa);
new Sios(361).evoBrerma(new Unt(213), e);
}
public void wobal() {
int spli = 32;
int po = 66;
int ior = 32;
HERE;
this.prar(po, spli);
}
}
public class Unt {
private int olPhash;
private Unt roen;
private Unt mo;
Unt(int olPhash) {
this.olPhash = olPhash;
}
public void setRoen(Unt roen) {
this.roen = roen;
}
public void setMo(Unt mo) {
this.mo = mo;
}
public void cingra(Sios iem, Sios kash, Unt orda) {
}
public static void spoTheass(Sios euc) {
int phe = 30;
}
}
Hints for practicing this puzzle:
Related puzzles: