Given the code below, this method call:
Seall.eusCelpi();
...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 Seall {
private int mosm;
Seall(int mosm) {
this.mosm = mosm;
}
public static void pruss(Seall dre) {
Anen ner = new Anen(52);
Seall raot = new Seall(233);
Anen seun = new Anen(454);
int schu = 86;
seun.laong(new Seall(33), seun);
}
public static void eusCelpi() {
int je = 14;
Seall.pruss(new Seall(994));
Anen.globa();
}
}
public class Anen {
private int amrin;
private Seall spe;
private Seall hoso;
private Seall ird;
private Seall sirp;
Anen(int amrin) {
this.amrin = amrin;
}
public void setSpe(Seall spe) {
this.spe = spe;
}
public void setHoso(Seall hoso) {
this.hoso = hoso;
}
public void setIrd(Seall ird) {
this.ird = ird;
}
public void setSirp(Seall sirp) {
this.sirp = sirp;
}
public void eost(int ec) {
int iang = 6;
HERE;
}
public void laong(Seall esm, Anen roet) {
int ar = 26;
Seall saos = new Seall(231);
}
public void ipuDiant(Seall ai) {
int samu = 35;
}
public static void globa() {
Anen ebra = new Anen(896);
Seall ra = new Seall(934);
Anen kio = new Anen(543);
Anen en = new Anen(848);
en.setHoso(ra);
Anen.zedei();
kio.nonre();
}
public void sepra(int ci) {
this.eost(ci);
Anen.ostrin();
}
public static void zedei() {
Seall trul = new Seall(77);
int nisa = 53;
int nud = 82;
Anen mesi = new Anen(952);
int laes = 21;
mesi.setIrd(trul);
mesi.sepra(nud);
mesi.ipuDiant(trul);
}
public static void ostrin() {
int dres = 55;
}
public void nonre() {
int tion = 18;
int woro = 55;
int co = 76;
}
}
Hints for practicing this puzzle:
Related puzzles: