3:53 pm - Saturday March 24, 2373

LinkedList Example Program for contains(Object o)

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.com
Description: It will return the hashcode value of the object which we creates.
 */
import java.io.IOException;
import java.util.*;

public class LinkedListContainExample {
	public static void main(String args[]) {
		int b = 1;
		boolean a;
		LinkedList l = new LinkedList();
		l.add(b);
		a = l.contains(b);// return true if the specified element in the list
		System.out.println(a);
		System.out.println(b + " ? is present in the list?");
	}
}

Output
True
1 is present in the list

Filed in: Z-A All Java Codes

Comments are closed.