Given the code below, this method call:
Deng.hord();
...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 Deng {
private int coEce;
private Getse me;
Deng(int coEce) {
this.coEce = coEce;
}
public void setMe(Getse me) {
this.me = me;
}
public static void hord() {
Getse oul = new Getse(761);
Deng scio = new Deng(120);
Deng casm = new Deng(945);
Deng.peansa(new Getse(892));
casm.setMe(oul);
Deng.oecEnte();
}
public static void oecEnte() {
Deng orne = new Deng(673);
new Getse(438).indphe();
}
public static void peansa(Getse esma) {
int pran = 17;
int plen = 90;
Getse vo = new Getse(465);
}
public static void irdra(Getse eahe, Getse deel, Getse lu) {
}
}
public class Getse {
private int cla;
private Deng prer;
private Deng rer;
Getse(int cla) {
this.cla = cla;
}
public void setPrer(Deng prer) {
this.prer = prer;
}
public void setRer(Deng rer) {
this.rer = rer;
}
public void indphe() {
Getse.hittwa();
Getse.husec(this);
}
public static void hittwa() {
}
public static void husec(Getse spi) {
Deng.irdra(spi, spi, spi);
HERE;
}
}
Hints for practicing this puzzle:
Related puzzles: