title: can i initialize an array outside the method just like we initialize a member/field variable
body: <p>i want to initialize the array at the instance level but i am not able to initialize here is the code </p>
  
  <pre><code>public class Arrays {
  
      /** Creates a new instance of Arrays */
  
          int []arr2=new int[2];
          arr2[0]=20;//error at compile time
          arr2[1]=30;//error 
  
  
      public Arrays() {        }
      public static void main(String []args)
      {
          System.out.println("Element at 0th position is "+arr2[0]);
          System.out.println("Element at 1th position is "+arr2[1]);
      }
  
  
  }
  </code></pre>