Srinivasa Raghavan
,
Ranch Hand
When a method is overrided there is a restriction that the method in the sub class cannot be more restrictive than the original.
public void print() {} cannot be overrided to
protected void print() {}
But what about the default access specifier i.e "void print() {}" ?
Jimmy Die
,
Ranch Hand
Hi,
Default is more restrictive then protected and less then private.
Srinivasa Raghavan
,
Ranch Hand
So the it's like this
private --> default ---> protected --> public
Layne Lund
,
Ranch Hand
I assume the arrow (-->) means "is more restrictive than". If so, then you are correct.
Layne
[ February 24, 2005: Message edited by: Layne Lund ]
Right! We're on it! Let's get to work tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com