9:23 am - Thursday February 23, 2017

Hashtable Example program for entrySet()

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: Returns a Set view of the entries contained in this Hashtable
*/
import java.util.*;
import java.util.Hashtable;
import java.io.IOException;
public class HashtableEntrySetExample
{
public static void main(String args[])throws IOException
{
int s=33, s1=44,s2=55;
Hashtable h=new Hashtable();
h.put(1,s);
h.put(2,s1);
h.put(3,s2);
h.entrySet();  //returns the set of values given in the hash table
System.out.println(h);
}
}

Output :
{3=55, 2=44, 1=33 }

Filed in: Core Java Tutorial

Comments are closed.