title: Why do we use 'new' keyword with primitive data types like `boolean`, to create array?
body: <p>In java, the two data types are reference types and primitive types. Reference types are references to objects while primitive types directly contain values.</p>
  
  <p>now, the <code>new</code> keyword in java is used to create the instance of an Object, for example,</p>
  
  <pre><code>String s3 = new String("foo")
  </code></pre>
  
  <p>or </p>
  
  <pre><code>String[] myStringArray = new String[3];
  </code></pre>
  
  <p>This is ok because <code>String</code> is a class and not a primitive data type.</p>
  
  <p>but since <code>boolean</code> or <code>int</code> are primitive data types, why do we use <code>new</code> keyword with them when creating an array,</p>
  
  <pre><code>int[] myIntArray = new int[3];
  int[] myIntArray = new int[]{1,2,3};
  boolean[] array = new boolean[size];
  </code></pre>
  
  <p>Shouldn't <code>new</code> keyword be only use with reference data types ?</p>