i have tried the following code in net beans i am expecting error but i didn't get any error
class B {
private void method() {
}
public static void main() {
B b = new B();
B c = new C();
b.method();
c.method();
}
}
class C extends B {
}
When c.method()
tries to access the method it should show error but in NetBeans it is not showing. Please tell me what is the fault.