title: For-each and assigning to a 2d array Java
body: <p>I'm using a for-each loop to move through a 2d array of chars in a basic java program. It works, except for a small part at the end. Here is my class:</p>
  
  <pre><code>static String letters = "abcdefghijklmnopqrstuvwxyz";
  
  public static boolean checkIsNumeric(String s) {
      boolean haveBeenNonDigitCharacters = false;
      char[] chars = s.toCharArray();
      for(char c : chars)
          if(!Character.isDigit(c)) {
              haveBeenNonDigitCharacters = true;
              break;
          }
  
      if(haveBeenNonDigitCharacters) 
          return false;
      else 
          return true;
  }
  
  public static char[][] createArray() {
      String height;
      String width;
      Scanner s = new Scanner(System.in);
      do {
          System.out.println("How tall do you want the array to be?");
          height = s.next();
      } while(!checkIsNumeric(height));
      do {
          System.out.println("How wide do you want the array to be?");
          width = s.next();
      } while(!checkIsNumeric(width));
  
      int intHeight = Integer.parseInt(height);
      int intWidth = Integer.parseInt(width);
  
      char[][] chars = new char[intWidth][intHeight];
  
      for(char c[] : chars) {
          for(char d : c)
              d = ' ';
      }
  
      return chars;
  }
  
  public static char[][] fillArray(char[][] a) {
      int counter = 0;
      for(char c[] : a) {
          for(char d : c) {
              if(counter &gt;= 26)
                  counter = 0;
              d = letters.charAt(counter);
              counter++;
          }
      }
      return a;
  }
  
  public static void main(String[] args) {
      char[][] chars = createArray();
      chars = fillArray(chars);
  
      for(char c[] : chars) {
          for(char d : c) {
              System.out.print(d);
              if(d == ' ')
              System.out.print("a");
          }
          System.out.println("");
      }
  }
  </code></pre>
  
  <p>Basically, what I want to do, is take any 2d array with user-specified dimensions, and fill it with the letters of the alphabet over and over until it is full. The <code>checkIsNumeric</code> method just checks to see if a <code>String</code> is numeric, the <code>createArray</code> method creates the 2d array with the user-specified dimensions, and the <code>fillArray</code> method fills the array with letters from the string. But when I loop through the array at the end of main and print each character, nothing gets printed. Why?</p>