Hashtable is a class in Java collections which implements Map interface and extends the Dictionary Class Contains only unique elements and its synchronized
import java.util.*; public class HashtableDemo { public static void main(String args[]) { // create and populate hash table Hashtable<Integer, String> map = new Hashtable<Integer, String>(); map.put(101,”C Language”); map.put(102, “Domain”); map.put(104, “Databases”); System.out.println(“Values before remove: “+ map); // Remove value for key 102 map.remove(102); System.out.println(“Values after remove: “+ map); } } |
About us and this blog
We are a digital marketing company with a focus on helping our customers achieve great results across several key areas.
Request a free quote
We offer professional SEO services that help websites increase their organic search score drastically in order to compete for the highest rankings even when it comes to highly competitive keywords.
Subscribe to our newsletter!
More from our blog
See all posts
Section 112.1: Avoiding Reading and Writing Data Simultaneously Sometimes, you want your…
Section111.1:IsHighResolution The IsHighResolution property indicates whether the timer is based on a…
Section110.1:MultithreadedTimersSystem.Threading.Timer-Simplestmultithreadedtimer.Containstwomethodsandoneconstructor. Example: A timer calls the DataWrite method, which writes "multithread executed…"…
Section109.1:UsingStreams Astreamisanobjectthatprovidesalow-levelmeanstotransferdata.Theythemselvesdonotactasdata containers. Thedatathatwedealwithisinformofbytearray(byte[]).Thefunctionsforreadingandwritingareallbyte orientated, e.g. WriteByte(). Therearenofunctionsfordealingwithintegers,stringsetc.Thismakesthestreamverygeneral-purpose,butless simpletoworkwithif,say,youjustwanttotransfertext.Streamscanbeparticularlyveryhelpfulwhenyouare dealing with large…
Section108.1:CheckedandUnchecked C#statementsexecutesineithercheckedoruncheckedcontext.Inacheckedcontext,arithmeticoverflowraisesan exception. In an unchecked context, arithmetic overflow is ignored and…
Section107.1:Asimpleindexer classFoo { privatestring[]cities=new[]{"Paris","London","Berlin"}; publicstringthis[intindex] { get{ returncities[index]; } set{ cities[index]=value; }…
Section106.1:System.Stringclass InC#(and.NET)astringisrepresentedbyclassSystem.String.Thestringkeywordisanaliasforthisclass. The System.String class is immutable, i.e once created its state…
Section105.1:TypesofPolymorphism Polymorphism means that a operation can also be applied to values…
No Comments
Recent Posts
- Chapter112:Threading 12/05/2024
- Chapter111:Stopwatches 11/05/2024
- Chapter110:Timers 10/05/2024