-
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);
-
try removing that "1000"
comps = delete(tree);
or add the "1000" in
public int delete1000(BSTree tree)
if this is being called outside of the class it's defined in, then you need an object
someObject.delete(aTree):
or
someObject.delete1000(aTree):
perhaps
comps = tree.delete(aTree);
where "tree" is a BSTree object.