|
-
Apr 13th, 2001, 12:38 PM
#1
Thread Starter
Member
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);
-
Apr 13th, 2001, 02:23 PM
#2
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|