8:24 pm - Thursday April 25, 2019

Hashtable Example program for values()

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

Here is the hash table sample program for values, in this sample hashtable program adding values within the double quotes as shown in the following example program.

 

*@author:candidjava.com
*@description:hash table for values
*/
import java.util.Hashtable;
public class Hashtable {
public static void main(String[] args){
Hashtable h=new Hashtable();
h.put(2,"3"); //to add first value
h.put(3,"4"); //to add second value
h.put(6,"3"); //to add third value
System.out.println("Displays stored values are "+h.values()); //shows the stored values
}
}

 

Output:

Displays stored values are [3, 4, 3]

BACK

Filed in: Z-A All Java Codes

Comments are closed.