This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
The access level cant be more restrictive than the overridden methods.
This means if the super class method is declared protected then the overridding method in the sub class cannot be either private or default access level. It must have either protected or public access level.
Life is easy because we write the source code.....
Please check carefully. doit() is declared as "private" method in class "A"
Hence it is NOT visible in sub classes
all doIt() methods in sub class are NOT overriding the class "A" method, it is just a re definition of method. Hence no RULES of overriding apply here !