Given the code below, this method call:
Bep.geos();
...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 Bep {
private int baDio;
private Bep bomu;
private Bep idpo;
private Fiis ippa;
Bep(int baDio) {
this.baDio = baDio;
}
public void setBomu(Bep bomu) {
this.bomu = bomu;
}
public void setIdpo(Bep idpo) {
this.idpo = idpo;
}
public void setIppa(Fiis ippa) {
this.ippa = ippa;
}
public static void dusint(int ved) {
int iant = 92;
int wo = 23;
Fiis.ufas(wo);
}
public void pinoll(int ilam) {
}
public static void geos() {
int du = 55;
Bep.schep(du, new Bep(39), du);
Fiis.boust(du, new Fiis(112));
Bep.dusint(du);
}
public static void schep(int va, Bep aroc, int wrir) {
Fiis ner = new Fiis(643);
new Bep(461).pinoll(21);
}
}
public class Fiis {
private int feec;
private Bep ri;
Fiis(int feec) {
this.feec = feec;
}
public void setRi(Bep ri) {
this.ri = ri;
}
public void badish() {
Bep sa = new Bep(303);
int boua = 15;
int tac = 45;
Fiis ords = new Fiis(989);
ords.setRi(sa);
this.meemed(boua);
Fiis.nihas(tac);
}
public static void nihas(int lu) {
int hi = 96;
int hux = 15;
int fua = 3;
int agat = 78;
}
public static void ufas(int qeck) {
int cae = 70;
int sece = 19;
int us = 14;
}
public void esha(int epe) {
int glic = 11;
int pti = 39;
HERE;
}
public void vasor(Fiis pid, int fion) {
int ji = 88;
}
public void meemed(int deng) {
int ja = 70;
Fiis rai = new Fiis(152);
int faan = 56;
this.vasor(this, faan);
rai.esha(faan);
}
public static void boust(int seo, Fiis ic) {
Bep noie = new Bep(396);
ic.setRi(noie);
new Fiis(741).badish();
}
}
Hints for practicing this puzzle:
Related puzzles: