If a sub-class member has the same name (and same signature in case of methods) as that of a super-class member then it hides the super-class member.
Although both the members might be available in the sub-class but using member name we can only access sub-class member as it hides the member of the same name in the super-class.
There is a way of accessing a hidden member, which is discussed in the next section.
No comments:
Post a Comment