On Jun 1, 9:04 am, "[email protected]"
<[email protected]> wrote:
> Hello all,
>
> I am a little bit confused with the concept of inheritance. In
> the lecture provided for Lab 1023,
> in slide 9
> "If the subclass is in the same package as its parent it also inherits
> the package-private members (fields
> or methods) of the parent"
package-private is not the same as private, actually package-private
is the default (no modifier). As the name implies package-private
designates private to a package. As a package is just a hierarchy
tree, you can deduce from it that if a child is in the same package
than its parent, and if nothing else is defined as private, then the
child inherits from the package-private members of its parent.
See the Sun site where it is explained:
http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---