
-----------------------------------
Zren
Fri Oct 01, 2010 11:34 pm

Object -&gt; Object[]
-----------------------------------
How would I test, and then convert a Object into an array of Objects?

Edit: Ha hah! I figured it out. Any better solutions?


Class classType = obj.getClass().getComponentType();
if (classType != null) { // Is this an Array of objects?
     Object

-----------------------------------
Generic
Sun Oct 03, 2010 9:18 pm

RE:Object -&gt; Object[]
-----------------------------------
Object obj = new Object();
Object[] arr = {obj};
Creates a new Object then initialize an array with one element "obj".
