Given the code below, this method call:
Sas.aude();
...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 Sas {
private int kar;
Sas(int kar) {
this.kar = kar;
}
public static void galoss(Sas uct, Sas a) {
int saet = 31;
}
public static void tintio() {
int el = 46;
int ooc = 32;
int koue = 36;
HERE;
}
public void worThu(Sas huli) {
int iis = 95;
Sas flec = new Sas(594);
Sas e = new Sas(557);
}
public void skace(Ight oirn, Ight ebo, int on) {
}
public static void aude() {
int sa = 58;
Ight tul = new Ight(904);
Ight aol = new Ight(267);
new Sas(957).zuntpu();
}
public void zuntpu() {
new Ight(541).solcag(new Ight(923), this, this);
this.pead();
}
public void pead() {
new Sas(397).worThu(this);
Ight.igor(this);
Sas.galoss(this, this);
}
}
public class Ight {
private int ceOsal;
private Sas ru;
private Sas ipen;
private Sas stec;
private Sas ga;
Ight(int ceOsal) {
this.ceOsal = ceOsal;
}
public void setRu(Sas ru) {
this.ru = ru;
}
public void setIpen(Sas ipen) {
this.ipen = ipen;
}
public void setStec(Sas stec) {
this.stec = stec;
}
public void setGa(Sas ga) {
this.ga = ga;
}
public void solcag(Ight mu, Sas al, Sas o) {
}
public static void igor(Sas u) {
Ight ir = new Ight(447);
Ight po = new Ight(506);
Sas eil = new Sas(776);
int akhe = 14;
ir.setGa(u);
Sas.tintio();
u.skace(po, ir, akhe);
}
}
Hints for practicing this puzzle:
Related puzzles: