Find First Non-repeated Character in a String – Java Code

Write a java program to find first non-repeated character in a string. Given an input string, Write a java code to find first non-repeated character in a string.

For example –

i) Input string – java
Output – j (j is the first non-repeating character in a string)

ii) Input string – web rewrite
Output – b (b is the first non-repeating character in a string)