Given the code below, this method call:
Maner.siar();
...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 Maner {
private int rore;
private Maner zo;
private Gren li;
private Gren gnic;
Maner(int rore) {
this.rore = rore;
}
public void setZo(Maner zo) {
this.zo = zo;
}
public void setLi(Gren li) {
this.li = li;
}
public void setGnic(Gren gnic) {
this.gnic = gnic;
}
public static void pitga() {
Maner.ipind();
}
public static void ipind() {
int shos = 6;
int apre = 5;
int ud = 71;
int tro = 43;
Gren.pumbar(apre, ud);
Gren.birGomei();
Maner.iard();
}
public void ceaGiw(Gren ves, Gren ifad) {
int ie = 91;
Maner.cickce();
}
public static void siar() {
Gren as = new Gren(530);
Gren eis = new Gren(305);
Maner be = new Maner(261);
as.setSua(be);
new Gren(333).atac(as, new Maner(303), be);
be.ceaGiw(eis, as);
}
public static void cickce() {
int ecri = 10;
int crui = 87;
int tasm = 23;
int cio = 0;
}
public static void iard() {
int ptoc = 20;
int uim = 83;
int lo = 26;
int ea = 86;
}
}
public class Gren {
private int ded;
private Maner sua;
Gren(int ded) {
this.ded = ded;
}
public void setSua(Maner sua) {
this.sua = sua;
}
public static void pumbar(int i, int uon) {
int lio = 21;
int qen = 55;
int oia = 85;
}
public static void esspo(int pe, int kres, int ciji) {
}
public static void birGomei() {
int tud = 11;
int xua = 57;
int bri = 93;
int sict = 88;
int upen = 76;
Gren.esspo(sict, xua, tud);
HERE;
}
public void atac(Gren ti, Maner e, Maner lipi) {
Gren in = new Gren(825);
e.setGnic(in);
Maner.pitga();
}
}
Hints for practicing this puzzle:
Related puzzles: