Home C C++ Java Python Perl PHP SQL JavaScript Linux Selenium QT Online Test

Home » Java » Programs » Find occurence of characters

Java program to find occurence of characters

This progrm takes any string as a input from users and print the occurence of each charaacters.

//Main.java file
import java.util.Scanner;
import java.util.*;  

public class Main
public static void main(String[] args) {
	Scanner input = new Scanner(System.in);
	System.out.println("Input Any String");
	String myString = input.next();
	HashMap hm=new HashMap();  
	for(int i = 0; i System.out.print(key + "" + value));		
occurence of characters in string in java
occurence of characters in string in java program 2