Lets see how to convert List to Array.
Code Description:
In this program we have taken a List of type String as shown below. For this we
have used Mylist.add to add the contents of the list as shown below. Then we
have used a method Mylist.toArray
to convert the List to Array.
Here is the code of this program:
import java.util.*;
|
Output of the program:
| C:\unique>javac ListToArr.java C:\unique>java ListToArr Javaisawonderfullanguage C:\unique> |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Convert List to Array View All Comments
Post your Comment