title: How to find the most frequently occurring character in a string with Java?
body: <p>Given a paragraph as input, find the most frequently occurring character. Note that the case of the character does not matter. If more than one character has the same maximum occurring frequency, return all of them
  I was trying this question but I ended up with nothing. Following is the code that I tried but it has many errors I am unable to correct:</p>
  
  <pre><code>public class MaximumOccuringChar {
  
      static String testcase1 = "Hello! Are you all fine? What are u doing today? Hey Guyz,Listen! I have a plan for today.";
  
      public static void main(String[] args) 
      {
          MaximumOccuringChar test = new MaximumOccuringChar();
          char[] result = test.maximumOccuringChar(testcase1);
          System.out.println(result);
      }
  
      public char[] maximumOccuringChar(String str) 
      {
          int temp = 0;
          int count = 0;
          int current = 0;
  
          char[] maxchar = new char[str.length()];
  
          for (int i = 0; i &lt; str.length(); i++) 
          {
              char ch = str.charAt(i);
  
              for (int j = i + 1; j &lt; str.length(); j++) 
              {
                  char ch1 = str.charAt(j);
  
                  if (ch != ch1) 
                  {
                      count++;
                  }
              }
  
              if (count &gt; temp) 
              {
                  temp = count;
                  maxchar[current] = ch;
                  current++;
              }
          }
          return maxchar;
      }
  }
  </code></pre>