3:32 pm - Sunday August 20, 2017

Add elements to LinkedList using boolean add(E e)

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

BACK

This tutorial explains how  to Add elements to LinkedList using boolean add() method.

Ensures that this collection contains the specified element.

 Returns true if   this collection changed as a result of the call.

Example

import java.util.LinkedList;
public class DisplayList

{

   public static void main(String a[])

  {         

      LinkedList<String> arr = new LinkedList<String>();

      arr.add("First");

      arr.add("Second");

      arr.add("h");

      System.out.println("Linked List contains list elements: " +arr);

   }

}

Output

           LinkedList contains list elements: [First, Second, h]

 

BACK

Filed in: Java Examples

Comments are closed.