This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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


Win a copy of Building Microservices this week in the Design forum!
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Entry class problem, add method not working properly.
 
It's not a secret anymore!