Good Afternoon in my timezone.

I have a "simple" question.

I have an ArrayList , but when i transform this ArrayList to array using the method toArray from the ArrayList object and cast it to Message[] it throws an java.lang.ClassCastException ? The Message class belongs to package "javax.mail.Message"
Snippet of code :

```
 List<Message> messageList = new ArrayList<Message>();
    --code to fullfill the List
   (Message[]) messageList.toArray();

```

Throws and exception: 
***Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljavax.mail.Message;***

Can anyone explain me why this happen ?

With the best regards