Hi people I'm new to posting here so sorry if I get the code wrapping thing wrong
Bascially I think I'm having a heirachy problem and its probably really obvious.
This is the the class with the error. The top line gives me an error saying cannot find symbol, constructor Something().
public class ExecutionStackDemo extends Something
{
public 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);
}
}
and this is the class I'm trying to refer to..
public class Something
{
public 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 + ")");
}
Hope this comes out properly. Would be thankful for any help :)