I keep getting this message when I compile my program.


Cannot reference member 'int delete1000(BSTree tree)' without an object (J0059).
I have listed the code for the method below and the calling statement.

All help will be most appreciated
Sean.


public int delete(BSTree tree)
{
Object returned = new Object();
int totalcomps = 0;
int count = 0;
int key = 0;
while (count<1000)
{
key = duplicateKey(tree);
Object ikey= new Integer(key);
returned = tree.remove(ikey);
totalcomps = totalcomps;
count++;
}
}

.....
BSTree tree = new BSTree(compareKeys);
......
comps = delete1000(tree);