Results 1 to 2 of 2

Thread: i need help with an error message

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2001
    Location
    Glasgow
    Posts
    47

    Unhappy

    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);

  2. #2
    VirtuallyVB
    Guest
    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
  •  



Click Here to Expand Forum to Full Width