You declared ia as Object, but the constructor only accepts Object[] arrays. So the compiler complains when you call the constructor.

Notice that you actually assigned an array to ia. That's quite legal because you can assign *any* reference type to an Object variable. But when it comes time to call the constructor the compiler won't be happy until you change ia and declare it to be an array.

12-15-2011, 10:23 AM

mpankhurst

Re: Error Passing Object through a constructor

Ok I read your response and I thought I understood it. I did some google work to find the best way to convert an ArrayList to and Object[]. What follows is the code I'm using for choice 2. Unfortunately I'm doing something wrong as this still gets me the same error. Here is my my code for choice 2: