File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 4543

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.
I agree. Here's the link:
subject: Unable to add object to array.
It's not a secret anymore!