Java Tutorial #58 - Java Weak HashMap Class with Examples (Map Data Structure)

preview_player
Показать описание
Java Tutorial #58 - Java Weak HashMap Class with Examples (Map Data Structure)
In this video by Programming for Beginners we will learn Java WeakHashMap Class with Examples (Map Data Structure), using Java Tutorial videos.

The WeakHashMap class of the Java collections framework provides the feature of the hash table data structure..
It implements the Map interface.

Difference Between HashMap and WeakHashMap
All functionalities of hashmaps and weak hashmaps are similar except keys of a weak hashmap are of weak reference, whereas keys of a hashmap are of strong reference.

Example:
// Creating WeakHashMap of numbers
WeakHashMap String, Integer numbers = new WeakHashMap ();

String two = new String("Two");
Integer twoValue = 2;
String four = new String("Four");
Integer fourValue = 4;

// Inserting elements

// Make the reference null
two = null;

// Perform garbage collection

Methods:
- Create a WeakHashMap
- Add elements in WeakHashMap
- Access elements of WeakHashMap
- Remove elements from WeakHashMap

Map Methods:
put(K, V) method
putAll() method
putIfAbsent(K, V) method
get(K) method
keySet() method
values() method
entrySet() method

==========

We can learn Java Programming language to make web applications or mobile applications for android phones and several other applications for windows, Mac OS and Unix operating systems. Also we can make android applications using Java programming. The concepts covered will be related to basic java and core java that will help you in your next interview questions. You can use any version of Java but all concepts will be same for all java versions. I will be using Java SE 8.
Java is a high-level programming language. Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.
Java is a MUST for students and working professionals to become a great Software Engineer specially when they are working in Software Development Domain.

Java Tutorial for Beginners Playlist:

Java JDK:
Eclipse IDE:

YouTube Gears:

#JavaTutorial #JavaForBeginners #Programming #Java

============================
LIKE | SHARE | COMMENT | SUBSCRIBE

Thanks for watching :)
Рекомендации по теме
Комментарии
Автор

If you initialize the strings throught the literals it stop working (System.gc won't delete the objects)

dead_md
visit shbcf.ru