| Author |
How to convert java.util.List to Array?.
|
Krish Pinnamaneni
Greenhorn
Joined: Mar 16, 2005
Posts: 22
|
|
Hi, Can any body help me how to convert java.util.List a1 = new ArrayList(); to Object[] . In Advance, Thanks, Krish
|
 |
Nischal Tanna
Ranch Hand
Joined: Aug 19, 2003
Posts: 182
|
|
use toArray() method to get the Object[] out of it a1.toArray();
|
Thnx
|
 |
Poobhathy Kannan
Ranch Hand
Joined: May 26, 2004
Posts: 94
|
|
Check the java api doc Object[] toArray() Returns an array containing all of the elements in this list in proper sequence. Object[] toArray(Object[] a) Returns an array containing all of the elements in this list in proper sequence; the runtime type of the returned array is that of the specified array.
|
http://learnertobeginner.blogspot.com/
|
 |
Parameswaran Thangavel
Ranch Hand
Joined: Mar 01, 2005
Posts: 485
|
|
what about the returned type of the array for the first method object toArray() { }
|
 |
Animesh Shrivastava
Ranch Hand
Joined: Jul 19, 2004
Posts: 298
|
|
Look at this post, toArray
|
 |
 |
|
|
subject: How to convert java.util.List to Array?.
|
|
|