Given the code below, this method call:
Mec.ebeCeska();
...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 Mec {
private int vuHeoun;
private Evik be;
private Evik cas;
Mec(int vuHeoun) {
this.vuHeoun = vuHeoun;
}
public void setBe(Evik be) {
this.be = be;
}
public void setCas(Evik cas) {
this.cas = cas;
}
public static void ebeCeska() {
Mec se = new Mec(581);
int a = 54;
Evik osno = new Evik(978);
new Mec(519).efong(new Evik(723), a);
se.setCas(osno);
new Evik(921).darxus();
}
public void efong(Evik peci, int er) {
}
public static void irpa(Evik i, int me) {
int od = 21;
}
}
public class Evik {
private int olhe;
Evik(int olhe) {
this.olhe = olhe;
}
public static void snos(Evik dati) {
int siea = 87;
int bame = 11;
Mec.irpa(dati, siea);
HERE;
}
public void darxus() {
Mec erl = new Mec(983);
int qout = 46;
erl.setBe(this);
Evik.snos(this);
}
}
Hints for practicing this puzzle:
Related puzzles: