Header Ads

  • Breaking Now

    If the method to be overridden has access type 'protected', can subclass have the access type as 'private'?

    No, it must have access type as protected or public, since an overriding method must restrict access of the method it overrides.

    2 comments:

    1. So here you mean we cannot reduce the visibility of inherited method.

      ReplyDelete
    2. i didnt understand the logic here..can u please xplain in detail

      ReplyDelete

    Post Top Ad

    Post Bottom Ad