title: How can I call a method or a variable in switch statement from another case
body: <p>How can I call a method or a variable in switch statement from another case
  for example : 
  case 0:
  //I have a FOR loop in here to store int values in an ARRAY
  case 1:
  // here I want to print the values of the ARRAY from case 0</p>
  
  <p>FYI:
  the variables used in the FOR loop are all STATIC and the "i" variable that checks the length of the ARRAY is static too.
  2- myRandomArray is not Static (I know it's an Object lol)</p>
  
  <pre><code>                case 0:
                      for(i = 0 ; i &lt; myRandomArray.length ; i++)
                      {
                          myRandomArray[i] = myRandomObj.nextInt(MAXINT);                     
                      }
                  break;
                  case 1:
                          System.out.print(myRandomArray[i] + "  ");  
                  break;
  </code></pre>