S
Suresh Reddi
Hi,
I have doubt regarding protected modifier.
as per definition, the visibility of "protected" and "default" are
Visible to the package and all subclasses (protected).
Visible to the package-the (unfortunate) default. No modifiers are
needed.
My doubt is when "default" field/method is visible to package, it might
also visible to sub-class as well. then why "protected" is required?
Or is it so that, one class can become sub-class of a super-class from
other package?
Thanks in advance.
Suresh
I have doubt regarding protected modifier.
as per definition, the visibility of "protected" and "default" are
Visible to the package and all subclasses (protected).
Visible to the package-the (unfortunate) default. No modifiers are
needed.
My doubt is when "default" field/method is visible to package, it might
also visible to sub-class as well. then why "protected" is required?
Or is it so that, one class can become sub-class of a super-class from
other package?
Thanks in advance.
Suresh