Answers for "array to linkedlist java"

1

String array into LinkedList java

LinkedList ll = new LinkedList(Arrays.asList(sa));
Posted by: Guest on April-30-2020
0

arraylist to linkedlist java

import java.util.ArrayList;
import java.util.LinkedList;

public class Main {
	public static void main(String[] args){
		ArrayList<String> arrList = new ArrayList<>();
		arrList.add("Mango");
		arrList.add("Apple");
		arrList.add("Orange");
		System.out.println(arrList);
		// ArrayList to LinkedList
		LinkedList<String> linkList = new LinkedList<>(arrList);
		System.out.println("Linked List:");
		System.out.println(linkList);
	}
}
Posted by: Guest on August-13-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language