title: Invisible Objects in java
body: <p>The following code is part of a larger application:</p>
  
  <pre><code>public static void METHOD_NAME(Object setName, int setLength){
      tryLoop:
          for( ; ; ){
              try{
                  setName = new Stack(setLength);
                  break tryLoop;
              }catch (InstantiationException e){
                  System.err.println(e.getMessage());
                  SET_NUM(1);
                  continue tryLoop;
              }
          }
  }
  </code></pre>
  
  <p>Whenever I try to use the stack object that was initialized within the try block, it cannot be found unless the reference to it is within the try block.  Why is this and how can I avoid it in the future?</p>