Given the code below, this method call:
Leang.briOngac();
...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 Leang {
private int soIn;
private Psua bla;
private Leang ta;
Leang(int soIn) {
this.soIn = soIn;
}
public void setBla(Psua bla) {
this.bla = bla;
}
public void setTa(Leang ta) {
this.ta = ta;
}
public void edfra() {
Leang nusm = new Leang(373);
Leang.iormso(nusm);
this.setTa(nusm);
this.cemces();
}
public void cemces() {
int bili = 11;
int alwa = 25;
HERE;
Psua.chemal(alwa, 21, this);
}
public static void briOngac() {
new Psua(645).selmos(new Psua(101));
}
public static void iormso(Leang ne) {
int ri = 96;
int ecom = 22;
int o = 58;
}
}
public class Psua {
private int frel;
private Leang prol;
Psua(int frel) {
this.frel = frel;
}
public void setProl(Leang prol) {
this.prol = prol;
}
public void selmos(Psua to) {
Leang ulnu = new Leang(248);
int no = 16;
ulnu.setBla(this);
new Leang(537).edfra();
to.ophler(no, ulnu);
}
public void ophler(int ec, Leang sa) {
int hu = 95;
}
public static void chemal(int en, int glid, Leang psu) {
}
}
Hints for practicing this puzzle:
Related puzzles: