title: lock.lock() before try
body: <p>Is there any difference between:</p>
  
  <pre><code>private Lock lock = new ReentrantLock(true);
  
  public void getIn (int direction) throws InterruptedException {
  
       lock.lock();
       try {
           ...
  </code></pre>
  
  <p>and </p>
  
  <pre><code>...
  
  public void getIn (int direction) throws InterruptedException {
  
        try {
            lock.lock();
            ...
  </code></pre>
  
  <p>Compilation goes smoothly and also the program works (I mean the same output)</p>
  
  <p>Should I put lock.lock(); before or after try?...</p>
  
  <p>Thanks for any help</p>