Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to add object to array.

 
Edward Strife
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When trying to add person to my list I get the cannot find symbol.



My sorted list class:




My initial list class:

 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see a method called add in your list class.
Did you want to call the method called insert instead?
 
Matthew Brown
Bartender
Posts: 4567
8
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a really bad idea to name your classes after classes in the standard Java libraries - expecially ones that are commonly used. It just leads to confusion. So don't call your own class List. If you want to implement java.util.List, do that. If you don't, use a different name.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic