Given the code below, this method call:
Irpo.oenInasm();
...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 Irpo {
private int qac;
private Uicor sasm;
private Uicor repi;
private Irpo hird;
Irpo(int qac) {
this.qac = qac;
}
public void setSasm(Uicor sasm) {
this.sasm = sasm;
}
public void setRepi(Uicor repi) {
this.repi = repi;
}
public void setHird(Irpo hird) {
this.hird = hird;
}
public void cahec(int cri) {
int ime = 45;
Uicor.qilge(cri);
}
public static void wemi() {
int riu = 11;
int anpo = 17;
}
public void endou() {
Irpo prel = new Irpo(16);
int flae = 37;
int ea = 1;
this.setHird(prel);
Irpo.cerce(this, flae, ea);
this.gossnu(prel, ea, 2);
}
public void thal(Uicor lume, Irpo ard) {
Uicor edim = new Uicor(328);
int oxsu = 7;
edim.posm(this, new Irpo(620));
}
public void gossnu(Irpo qos, int esh, int ith) {
int esan = 5;
}
public static void oenInasm() {
Uicor ar = new Uicor(781);
Irpo shiu = new Irpo(913);
Irpo cin = new Irpo(803);
int lua = 94;
Irpo irla = new Irpo(166);
new Irpo(594).thal(ar, shiu);
cin.setRepi(ar);
new Irpo(387).endou();
irla.cahec(lua);
}
public static void cerce(Irpo nu, int mua, int ge) {
int ashu = 7;
nu.setHird(nu);
Uicor.skoDroo(mua, nu, ashu);
Irpo.wemi();
}
public static void dopri(int cang) {
int gaje = 89;
HERE;
}
}
public class Uicor {
private int siman;
private Uicor geam;
Uicor(int siman) {
this.siman = siman;
}
public void setGeam(Uicor geam) {
this.geam = geam;
}
public static void qilge(int alta) {
}
public void posm(Irpo cesi, Irpo piil) {
Irpo ri = new Irpo(464);
Irpo stro = new Irpo(23);
}
public static void skoDroo(int ses, Irpo eri, int osme) {
int cio = 56;
Irpo.dopri(ses);
}
}
Hints for practicing this puzzle:
Related puzzles: