How can I find the number of occurrences of a character in a string?
For example: The quick brown fox jumped over the lazy dog.
Some example
public class dublicate { public static void main(String...a) { System.out.print("Enter the String"); Scanner sc=new Scanner(System.in); String st=sc.nextLine(); int [] ar=new int[256]; for(int i=0;i0) { if(ar[i]==1) { System.out.print(ch); } else { System.out.print(ch+""+ar[i]); } } } } }