File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Entry class problem, add method not working properly. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Entry class problem, add method not working properly." Watch "Entry class problem, add method not working properly." New topic
Author

Entry class problem, add method not working properly.

Fredrik Komstadius
Greenhorn

Joined: Mar 29, 2002
Posts: 19
I have this weird problem that I can not figure out what do to with. I want to do the following thing with the help of my entry class:


The thing is that I get the following error:
incompatible types
found : BinSearchTreeArray.Entry
required: int
tree[temp].left = new Entry (o, temp);


I realise this might be a bit much for you guys to take a look at but any help would be greatly appreciated!
[ October 15, 2002: Message edited by: Fredrik Komstadius ]
[ October 15, 2002: Message edited by: Fredrik Komstadius ]
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
I don't see a declaration for "tree" anywhere in your code, so I don't know what fields it has or what type they are.
Also, you have "extends AbstractSet" in a comment where it won't have any effect.
You certainly cannot assign an Object (such as Entry) to an int.
[ October 15, 2002: Message edited by: Ron Newman ]

Ron Newman - SCJP 1.2 (100%, 7 August 2002)
Fredrik Komstadius
Greenhorn

Joined: Mar 29, 2002
Posts: 19
Tree is declared Entry[]Tree.
And yea, starting to see that I'm assigning invalid types to an int. Thanx for the help!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Entry class problem, add method not working properly.
 
Similar Threads
Implement methods for Iterator using Generics for TreeSet
Reducing duplicate/repetative code
BST problem (Online waiting)
Tournament Tree help
Inorder traversal of a Binary Search Tree