You just need to spend some time reading some basic tutorial on how to use
ArrayList. You will find thousands if you just google it.
Originally Posted by
93tomh
I am trying to add a contact to the array list using the variables in the Contact class.
Read again post #8.
You need to use the ArrayList's
add method. Do you know how to call non static methods of a class? - You create a new object of the class (instantiate the class) and then you call it with
objectOfClass.methodOfClass
In your code you have created a new
ArrayList (
contactList). With the above syntax you can call any method you want. Thus, read the ArrayList javadoc, find the method that suits your requirements (in your case the
add method) and call it with
contactList.methodYouWant