Given the code below, this method call:
Rasal.siploc();
...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 Rasal {
private int geDisma;
private Siaen or;
Rasal(int geDisma) {
this.geDisma = geDisma;
}
public void setOr(Siaen or) {
this.or = or;
}
public static void hilman(int in, int bou) {
int woch = 92;
int niwi = 99;
}
public static void nalAurt(Siaen ur, int esma) {
Siaen so = new Siaen(504);
so.setKhui(ur);
so.benfic(esma, new Siaen(851));
}
public static void siploc() {
int pror = 65;
Rasal.nalAurt(new Siaen(388), pror);
Rasal.hilman(pror, pror);
}
}
public class Siaen {
private int noss;
private Siaen khui;
private Rasal peut;
Siaen(int noss) {
this.noss = noss;
}
public void setKhui(Siaen khui) {
this.khui = khui;
}
public void setPeut(Rasal peut) {
this.peut = peut;
}
public void shret(Rasal im, Siaen pso, Siaen stal) {
}
public static void sotiw(int thas) {
Rasal ec = new Rasal(23);
}
public void benfic(int pame, Siaen u) {
Rasal cism = new Rasal(847);
Siaen.sotiw(pame);
u.setKhui(this);
u.wass();
this.shret(cism, u, this);
}
public void wass() {
Siaen trel = new Siaen(133);
HERE;
}
}
Hints for practicing this puzzle:
Related puzzles: