This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Entry class problem, add method not working properly.

 
Fredrik Komstadius
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Fredrik Komstadius
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tree is declared Entry[]Tree.
And yea, starting to see that I'm assigning invalid types to an int. Thanx for the help!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic