title: "Modifier 'private' not allowed here" - why not?
body: <p>I want to know why this problem occurs.</p>
  <pre><code>public class Sorter {
  
      public static char[] selectSort(String targetStr) {
  
          private char[] charArray = new char[targetStr.length()];
  </code></pre>
  <p>The problem occurs when the variable charArray is made private and there is a message:</p>
  <blockquote>
  <p>Modifier 'private' not allowed here.</p>
  </blockquote>
  <p>Can anyone explain to me thoroughly why this happens so that I can better handle them in the future?</p>