Classcast exception while using toArray()

#1 List<DVDInfo> dvds = getDVDList();

#2 DVDInfo[] dvdsArray = (DVDInfo[])dvds.toArray();

dvds is a list that has DVDInfo class objects when i try to get a array using line 2 i get class cast exception, Please help

Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object;

at com.sc.seven.TestArrayList.main(TestArrayList.java:73)

[386 byte] By [deepu-jaina] at [2007-11-27 8:52:13]
# 1
> #2 DVDInfo[] dvdsArray = (DVDInfo[])dvds.toArray();This returns Object[], not DVDInfo[]DVDInfo[] dvdsArray = (DVDInfo[])dvds.toArray(new DVDInfo[dvds.size()]);
jverda at 2007-7-12 21:07:15 > top of Java-index,Java Essentials,Java Programming...