3 Replies Latest reply on May 2, 2002 6:44 PM by 807554

    Array Problem

    807554
      K Can any1 give me a clue as to why i get this error :

      java.lang.ArrayIndexOutOfBoundsException
      at slope1.main(slope1.java:12)
      Exception in thread "main"

      Whe compiling this array :-

      public static void main (String args[]) {

      String triangle[] = new String [5];

      triangle[0] = "*";
      triangle[1] = "**";
      triangle[3] = "***";
      triangle[4] = "****";
      triangle[5] = "*****";

      for( int i=0; i<5; i++){
      System.out.println(triangle);

      any help would be appreciated im only a noob :)


      Thnx