5 Responses

  1. OOPS in Java
    OOPS in Java March 28, 2013 at 12:23 am |

    […] Overloading , Overriding […]

  2. chanti
    chanti May 6, 2013 at 2:25 pm | | Reply

    Hi Harsha, nice covering of all concepts related to overriding.
    But my doubt is, we know all these rules like we should not reduce the scope of parent class method in child class when we override the method and child class overriding method shouldn’t throw checked exceptions that are higher than the checked exceptions thrown by the parent class. Incase of parent class overridden method without any checked exception list, the child class overridden method has no choice to throw any checked exceptions even required also. Because of this scenario, the child class has no freedom to override parent class method to match/reach/achieve its requirement.

    I’m waiting for ur reply
    once again thanks for ur explanation………..

  3. Sampath
    Sampath February 23, 2014 at 2:07 pm | | Reply

    While overriding, we can increase scope of access-modifier but we can’t reduce. but Why?

  4. vedika seth
    vedika seth February 11, 2015 at 12:37 pm | | Reply

    Hi,
    In 7th point. I believe you wanted to write:
    System.out.println(p1.x); //777

Leave a Reply to chanti Cancel reply