Q:

Java Program to create a linked list

0

Java Program to create a linked list.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import java.util.*;
public class demo1
{
 public static void main(String[] args) 
 {
  List<String> list = new ArrayList<String>();
  list.add("C#");
  list.add("C++");
  list.add("Python");
  System.out.println("List of first array: " + list);

  List<String> list1 = new ArrayList<String>();
  list1.add("Perl");
  list1.add("Ruby");
  list1.add("Java");
  System.out.println("List of second array: " + list1);         
  
  ArrayList<String> lists = new ArrayList<String>();
  lists.addAll(list);
  lists.addAll(list1);
  System.out.println("New array: " + lists);
 }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now