This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Unable to add object to array. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Unable to add object to array." Watch "Unable to add object to array." New topic

Unable to add object to array.

Edward Strife

Joined: Mar 15, 2012
Posts: 14
When trying to add person to my list I get the cannot find symbol.

My sorted list class:

My initial list class:

E Armitage

Joined: Mar 17, 2012
Posts: 989
I don't see a method called add in your list class.
Did you want to call the method called insert instead?
Matthew Brown

Joined: Apr 06, 2010
Posts: 4541

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.
It is sorta covered in the JavaRanch Style Guide.
subject: Unable to add object to array.
It's not a secret anymore!