|
Technical Interview Questions
Visual Basic Interview Question
.NET Web Interview Questions
.NET
Interview Questions
C#
Interview Questions
.........More
Source Codes
Asp .NET Source Codes
Asp VB Script Source Codes
.........More
Soft Skills
Communication Skills
Leadership Skills
.........More
|
|
Asp/VB Script Source Codes
Code for HashTable
import java.util.Enumeration;
import java.util.Hashtable;
/**
*
* @author jimmi.prajapati
*
*/
public class HashTableDemo {
/**
*
* @param args
*/
public static void main(String args[]) {
// create a new Hashtable
Hashtable h = new Hashtable( 149 /* capacity */, 0.75f /* loadfactor */ );
// add some key/value pairs to the Hashtable
h.put( "WA" , "Washington" );
h.put( "NY" , "New York" );
h.put( "RI" , "Rhode Island" );
h.put( "BC" , "British Columbia" );
// look up a key in the Hashtable
String key = "NY";
String stateName = (String)h.get( key );
System.out.println( stateName );
// prints "New York"
// enumerate all the contents of the hashtable
Enumeration keys = h.keys();
while ( keys.hasMoreElements() )
{
key = (String)keys.nextElement();
stateName = (String)h.get( key );
System.out.println( key + " " + stateName );
// prints lines of the form NY New York
// in effectively random order.
} // end while
}
}
<<<----- Return to
Asp/VB Script Source
Code Questions Page.
Have a Question ?
post your questions here. It
will be answered as soon as possible.
Check
Microsoft .Net Interview Questions
for more Microsoft
.Net Interview Questions with Answers.
Check
.Net Database Interview
Questions for more .Net Database Interview Questions with answers
Check
Job Interview Questions
for more Interview Questions with Answers
|