Hi All,
In the books, it is given that a private method in a super class cannot be overridden in sub class.
But if i am trying do it, it is compiling without errors.
What is the correct statment?
Appreciate ur reply.
class Test1
{
private void method1()
{
System.out.println("super class method");
}
}
class Test2 extends Test1
{
public static void main(
String args[])
{
Test2 t2 = new Test2();
t2.method1();
}
void method1()
{
System.out.println("subclass method");
}
}