> How would I add a name called "Bob" for instance to
> 'names' ?
You can't. An array's size is fixed at creation time.
You can:
1) Replace an existing entry.
2) Create a new larger array, copy the existing elements into it, and then put the new entry into the last slot.
3) Use a Collection, such as an ArrayList or LinkedList.
http://java.sun.com/docs/books/tutorial/collections/
Not knowing your requirements or what you're really trying to do, my initial inclination would be #3.
Im trying this from this page i found: http://www.developer.com/java/other/article.php/3343771
I tried this:
List ips = new ArrayList();
When I do that I get this error from the compiler:
FileInOut.java:8: cannot find symbol
symbol : class List
location: class FileInOut
List ips = new ArrayList();
^
FileInOut.java:8: cannot find symbol
symbol : class ArrayList
location: class FileInOut
List ips = new ArrayList();
^
2 errors
Any reason why this doesn't work?
Thanks,
Harlin