Convert Array to List
From Java Example Source Code
Contents |
[edit] Overview - Convert Array to List
This Java example program shows how to convert Array to List.
[edit] Java Source Code
- Package: example.list
- File: Sort.java
package example.list; import java.util.Arrays; import java.util.Collections; import java.util.List; public class Sort { public static void main(String args[]) { String[] strArray = new String[] { "Java", "Source", "And", "and", "Support", "exampleshow" }; List l = Arrays.asList(strArray); Collections.sort(l); System.out.println(l); } }
[edit] What Result You Can Get
Run the program, you will get:
[And, Java, Source, Support, and, exampleshow]
[edit] Required External Libraries and/or Files for this Java Example
Need nothing.
[edit] How to Run this Java Example Program
We recommend running this Java example program with Eclipse.
For assistance in working with Eclipse, please see How to Run Java Program with Eclipse.
It's fairly easy.
[edit] Question & Answer
Any question?
Click edit and post your question or answer here.
