Java Coding ProblemsChapter 1: Strings, Numbers, and MathProblem StatementWrite a program that counts duplicate characters from a given String.Sample Input 1"aabcc" Sample Output 1{a=2, b=1, c=2} Source CodeMain ClassTest ClassQuestion taken from the book "Java Coding Problems" by Anghel Leonard. Formatted and uploaded by dbc2201