You can use the below the code to achieve that:
List<String> list=new ArrayList<String>();
list.add("Intellipaat");
list.add("Software");
list.add("Solution");
String names[]=list.toArray(new String[list.size()])
I hope this will help.
Want to become a Java Expert? Join Java Certification now!!
Want to know more about Java? Watch this video on Java Course | Java Tutorial for Beginners: