Given the code below, this method call:
Mic.cuisa();
...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 Mic {
private int anIcest;
private Caong ect;
Mic(int anIcest) {
this.anIcest = anIcest;
}
public void setEct(Caong ect) {
this.ect = ect;
}
public static void cuisa() {
int etri = 77;
Caong sesi = new Caong(763);
Mic.apiBris(etri);
Caong.pisnin(etri, new Caong(741), sesi);
}
public static void apiBris(int lo) {
Mic da = new Mic(446);
}
}
public class Caong {
private int stit;
Caong(int stit) {
this.stit = stit;
}
public static void pisnin(int whic, Caong erbi, Caong ta) {
HERE;
}
}
Hints for practicing this puzzle:
Related puzzles: