| Author |
How to access
|
Niyas Ahmed Sheikh
Ranch Hand
Joined: Jun 15, 2005
Posts: 129
|
|
Hi, Suppose I want to access the class A's method and variables(ofcourse public) from another class B, in which class B doesn't extend the class A. Simply I want to access the class A, and to create the instances of class A in the class B, without class B extending class A. For that what are the criteria or rules for it. I think we can do it in package and if so, some example codings will be very helpful.
|
 |
Mahesh x Bogadi
Ranch Hand
Joined: Jul 06, 2004
Posts: 51
|
|
____________________ package a; public class A { public String x; } ______________________ package b; import a.A; public class B { private A a; }
|
 |
 |
|
|
subject: How to access
|
|
|