Given the code below, this method call:
Iss.cach();
...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 Iss {
private int hio;
Iss(int hio) {
this.hio = hio;
}
public static void whuRasm(Isnus rass, Iss he, Iss be) {
}
public static void whung(Isnus fodi, Isnus iu) {
iu.setDrid(fodi);
iu.frePtion(fodi, new Iss(71));
}
public static void cach() {
Iss.whuRasm(new Isnus(600), new Iss(222), new Iss(653));
Isnus.flulol(new Iss(999), new Iss(126));
Isnus.sisan(76, 11, 82);
}
}
public class Isnus {
private int geac;
private Isnus drid;
private Iss blod;
private Iss uwei;
Isnus(int geac) {
this.geac = geac;
}
public void setDrid(Isnus drid) {
this.drid = drid;
}
public void setBlod(Iss blod) {
this.blod = blod;
}
public void setUwei(Iss uwei) {
this.uwei = uwei;
}
public void samu(Isnus pris) {
int su = 98;
int sesh = 1;
}
public static void flulol(Iss gren, Iss as) {
Isnus siel = new Isnus(479);
siel.setUwei(as);
Iss.whung(new Isnus(173), siel);
}
public void frePtion(Isnus olo, Iss mosa) {
olo.samu(this);
HERE;
}
public static void sisan(int osm, int gle, int ciss) {
}
}
Hints for practicing this puzzle:
Related puzzles: