Java program to Find First Non Repeated Character in a String using LinkedHashMap | Java Inspires

Опубликовано: 11 Октябрь 2024
на канале: Java Inspires
31
2

In this video, we will write a java program to find first non repeated character in a string using LinkedHashMap.

Why are we using LinkedHashMap?
Linked HashMap is an insertion-order map.
Here, linked hashmap is populated with characters as keys and the number of occurances as values.
Once is complete, it will print first key that has value equal to 1.
Thanks for the insertion-order feature.

#javainspires #codinginjava #javabeginners