arraylist to linkedlist java

Solutions on MaxInterview for arraylist to linkedlist java by the best coders in the world

showing results for - "arraylist to linkedlist java"
Lilli
19 Jul 2017
1import java.util.ArrayList;
2import java.util.LinkedList;
3
4public class Main {
5	public static void main(String[] args){
6		ArrayList<String> arrList = new ArrayList<>();
7		arrList.add("Mango");
8		arrList.add("Apple");
9		arrList.add("Orange");
10		System.out.println(arrList);
11		// ArrayList to LinkedList
12		LinkedList<String> linkList = new LinkedList<>(arrList);
13		System.out.println("Linked List:");
14		System.out.println(linkList);
15	}
16}