Q:

Java Program to extract a portion of a array list

0

Java Program to extract a portion of a array 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");
  list.add("Perl");
  list.add("Ruby");
  list.add("Java");
  System.out.println("Original list: " + list);
  List<String> sub_List = list.subList(1, 4);
  System.out.println("List of the elements: " + sub_List);
 }
}

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