3:11 pm - Thursday November 25, 8624

LinkedList Example Program for remove()

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
/**
*@author:candidjava
*@description:LinkedList Example Program for remove()
**/

import java.util.LinkedList;
public class Remove
{
public static void main(String[] args)
{
  // create a LinkedList
 LinkedList list = new LinkedList();
 // add some elements
      list.add("task");
      list.add(27);
      list.add("query");
      list.add("100");
 // print the list
System.out.println("LinkedList:" + list);
 // remove the head of the list
list.remove();
 // print the list
System.out.println("LinkedList:" + list);
   }
}


Output:

LinkedList:[task, 27, query, 100]
LinkedList:[27 , query , 100]

BACK

Filed in: Z-A All Java Codes

Comments are closed.