Ok, im an idiot.
Basically I am a class A idiot, ive left more coursework right to the last minute and Im hoplessly lost and confused about this question :
2: Tracing the Execution Stack
class Something
{
private int n;
public Something(int n)
{
this.n = n;
}
public void grow(int d)
{
this.n += d;
}
public boolean isNegative()
{
return (this.n < 0);
}
public String toString()
{
return ("something(" + this.n + ")");
}
}
public class ExecutionStackDemo
{
private static void m2(Something sth)
{
int i = 3;
sth.grow(2 * i);
i = 4711;
if (sth.isNegative())
{
sth.grow(i);
}
}
public static void main(String[] args)
{
int i = -2;
Something s = new Something(i);
m2(s);
}
}
For the code above, give an account of the evolution of the execution stack. Determine the sequence of invocations
of methods and constructors of the and the corresponding returns to the respective callers. Display the execution
stack after each time a new activation frame is created.
Basically put it all into netbeans, debugs and runs fine. My question is, what is an activation fram and how do I see them?
Anyhelp would be massively welcomed :)
Dave

