title: Beginning Java: Printing out a 5 pointed star using arrays
body: <p>I've been trying to print out a 5 pointed star but I keep on getting compile errors. </p>
  
  <pre><code>public class star 
  {
  
  
    public static void main(String[] args)
    {
  
      int[][] star1 =new int[first][last];
      int first = 5;
      int last = 2;
  
      for(int i = 0; i &lt; 5; i++)
      {
         for(int j = 0; j &lt; 2; j++)
  
         (char) star1[i][j] == "*";
  
          System.out.println(star1[i][j]);
     }
    }
   }
  }
  </code></pre>
  
  <p>These are the errors I'm getting: </p>
  
  <pre><code>Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
      first cannot be resolved to a variable
      last cannot be resolved to a variable
      Syntax error on token ")", throw expected after this token
      Incompatible operand types char and String
      j cannot be resolved to a variable at star.main(star.java:7)
  </code></pre>
  
  <p>I don't understand why we can't say <code>(char) star1[i][j] == "*"</code> How else can I assign an asterisk to <code>star1[i][j]</code>? </p>