use of exception in inheritance
<pre><code>class B {
    void process()throws Exception{
        System.out.println("hi sh");
    }

}
class C extends B {
    void process(){
        System.out.println("hhhhhh");
    }

    public static void main(String args[]){
        B a=new C();
        try{
             a.process();
        }
        catch(Exception e)
        {
        }
    }
}
</code></pre>

<p>Here while calling the process method, we have to use a try catch block.  But, if I store the object of C in reference variable of C only i.e. <code>C a=new C()</code> then try catch block is not needed.</p>

<p>Can anyone tell me the reason why?</p>
