title: Java error when I try to create an object with a constructor with a string parameter
body: <p>I created two constructors in my Move class, one with two <code>int</code> parameter and one with <code>String</code> parameter:</p>
  
  <pre><code>public Move(int row,int col)
  {
    int[] [] Move = new int[row][col]; 
  }   
  public Move(String r)
  {       
   String move = new String(r);    
  }
  </code></pre>
  
  <p>Then I try making an object:</p>
  
  <pre><code>Move m = new Move(1,1);
  m = new Move("E1");
    //The second one does not work and I get this as an error in java:
  
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 2
  at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:47)
  at java.base/java.lang.String.charAt(String.java:693)
  at Move.&lt;init&gt;(Move.java:16)
  at moveTester.main(moveTester.java:10)
  </code></pre>
  
  <p>how do I fix it, thank you!</p>