Question: I have the below code:

```
 contacts = new Contact[] { 
      new Contact(0, "Mercury")
  };  
}

```

What I want to do is add values from a list of contacts, rather than Strings like Mercury!

How would I go about this?

Answer: 
The easiest way to do this is using the `List.toArray` method. Assumming you have a `List<Contact> lstContacts` or similar:

```
Contact[] arrContacts = lstContacts.toArray(new Contact[0]);

```
If you have a `List<Contact> contactsList` with some data.

```
int size = contactsList.size();

Contact[] contacts  = new Contact[size];

for(int i = 0; i < size; i++ )
{
   // selection logic here--

   contacts[i] = contactsList.get(i);
}

```

Now you have a Array `Contact[]`.