posted 19 years ago
class A {
B b = new B();
public void showI(){
System.out.println(b.i);
}
class B {
private int i = 2;
}
}
Hi there,
Iam trying the above code with a successful compile and run with the following code:
A a = new A();
a.showI();
Iam just wondering how am I able to access private member of class B from A.
thanks in advance,
Ravi.