title: Even if I am storing the value of 1 array into another and print them as a whole but still the array prints the last value
body: <p>In this code I am having some problem that is I am trying to place the val array values in value array but still the array even though declared static is not storing.</p>
  
  <p>I am not able to figure out the problem. Please help me out.</p>
  
  <pre><code>public static int[] val = new int[100]    ;            
      public static int[] value = new int[100];
      public static void main(String[] args)
      {
  
          System.out.println("An incremented value");
          for(int i=2;i&lt;=2;i++) {
              String p="";
              for(int j=0;j&lt;=i;j++) {
                  for(int m=0;m&lt;j;m++) {
                      p=p+"&amp;";
                          }
                  for(int m=0;m&lt;i-j;m++) {
                      p=p+"|";
                          }
                   printAllPermutations(p);
                  p="";
  
                  for(int xy=0;xy&lt;8;xy++){
                  value[xy]=val[xy];
              System.out.println("["+xy+"]"+"="+val[xy]+"   ");      
                  }
              }
          }
          for(int y=0;y&lt;32;y++)
              System.out.println("["+y+"]"+"="+value[y]+"   ");     
  
      }
  </code></pre>
  
  <p>the output is::</p>
  
  <blockquote>
  <pre><code>An incremented value
  
  || opr:2    0 1 1 1 1 1 1 1[0]=0   
  [1]=1   
  [2]=1   
  [3]=1   
  [4]=1   
  [5]=1   
  [6]=1   
  [7]=1   
  
  &amp;| opr:2    0 1 0 1 0 1 1 1
  |&amp; opr:2    0 0 0 1 1 1 1 1[0]=0   
  [1]=0   
  [2]=0   
  [3]=1   
  [4]=1   
  [5]=1   
  [6]=1   
  [7]=1   
  
  &amp;&amp; opr:2    0 0 0 0 0 0 0 1[0]=0   
  [1]=0   
  [2]=0   
  [3]=0   
  [4]=0   
  [5]=0   
  [6]=0   
  [7]=1   
  [0]=0   //here in the value array its storing only the last array value.
  [1]=0   
  [2]=0   
  [3]=0   
  [4]=0   
  [5]=0   
  [6]=0   
  [7]=1   
  [8]=0   
  [9]=0   
  [10]=0   
  [11]=0   
  [12]=0   
  [13]=0   
  [14]=0   
  [15]=0   
  [16]=0   
  [17]=0   
  [18]=0   
  [19]=0   
  [20]=0   
  [21]=0   
  [22]=0   
  [23]=0   
  [24]=0   
  [25]=0   
  [26]=0   
  [27]=0   
  [28]=0   
  [29]=0   
  [30]=0   
  [31]=0
  </code></pre>
  </blockquote>
  
  <p>I want the 32 array to show the all 32 values. Please help me out. I dont know where I am going wrong.</p>