11:03 am - Sunday April 30, 2017

Add elements to linkedHashSet 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 method adds the specified elements to the set and return true if the elements is added successfully ,Otherwise it returns false.

Example Program


import java.util.LinkedHashSet;

public class LinkedHashSetAdd

{

	public static void main(String[] args)

	{

		LinkedHashSet lh = new LinkedHashSet();

		lh.add("Add");

		lh.add("Sub");

		lh.add("Mul");

		System.out.println("The set is:" + lh);

	}

}

Output

    The set is:[Add, Sub, Mul]

BACK

Filed in: Java Examples

Comments are closed.