title: Hi I'm beginner in java and started coding recently here's my program it showing an error of ArryIndexOutOfBound
body: <pre><code>// It's program of cars and it's colours
   
  import java.util.Scanner;
      class Details
        {
        String name;
       String colour;
       public Details( String name, String colour)
        {
          this.name=name;
          this.colour=colour;
        }
          }
  
            public class Car {
           public static void main(String[] args) {
          int i, num;
          Scanner sc=new Scanner(System.in); 
          System.out.println(&quot;enter the size&quot;);
          num=sc.nextInt();
          Details cars[]=new Details[num];
          System.out.println(&quot;enter name and colour&quot;);
          for( i=0;i&lt;cars.length;i++);
          {
              cars[i].name=sc.next();
              cars[i].colour=sc.next();
              System.out.println(&quot;name : &quot;+cars[i].name+&quot; \n colour :&quot;+cars[i].colour);
          }
          sc.close();
  
      }
         
  }
  </code></pre>