9:05 am - Friday May 25, 2018

Hashtable Example program for contains(Object value)

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: Tests if some key maps into the specified value in this hashtable
*/
import java.util.*;
import java.util.Hashtable;
import java.io.IOException;
public class HashtableContainsExample
{
public static void main(String args[])throws IOException
{
boolean b;
int s=33,s1=22,s3=44;
Hashtable h=new Hashtable();
h.put(1,33);
h.put(1,22);
b=h.containsValue(33);  //if the obj values are same means it returns true else false
System.out.println(b);
}
}

Output:
false


							
							
			
Filed in: Core Java Tutorial

Comments are closed.