Q:

Java Program to Insert an element into the list at the any position

0

Java Program to Insert an element into the list at the any position

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("Java");
  list.add("HTML");
  list.add("Ruby");
  System.out.println(list);
  list.add(0, "Python");
  list.add(4, "Perl");
  System.out.println(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