title: Can we catch UnsupportedOperationException
body: <p>In the following example, I am able to get the resulted printed though was expecting a Runtime exception. Since I have used catch block , does it mean I am able to catch the unchecked exception too? if so than why can't we simple proceed by putting catch block where we suspect a runtime exception to occur.</p>
  
  <p>Below is the code:</p>
  
  <pre><code>public class CollectionsSample {
  
  public static void main(String args[]) /*throws UnsupportedOperationException*/{
  
      Set&lt;String&gt; st = new HashSet&lt;String&gt;();
  
      st.add("akkhil");
      st.add("gupta");
      Collection&lt;String&gt; coll = Collections.unmodifiableCollection(st);
      try{
      coll.add("changed");
      }catch(Exception e){
          //throw e;
      }
  
      for(String s : st){
          System.out.println(" " + s);
      }
  
  }
  </code></pre>
  
  <p>This produces output as akkhil gupta though I was expecting it to through runtimeexcption at coll.add("changed");</p>