Hi,
I have three directories like this
c:\java
c:\java\p1
c:\java\p2
I have class A in package p1 and class B in package p2. What is the statement to import A to B? Also, if there is a package variable i in A, can i use it in B?
I have give the code snippets below.
<code>
package p2;
import p1.*;
public class B
{
A a=new A();
System.out.println(a.i);
}
------------------------------------------------------
package p1;
public class A
{
int i=10;
}
</code>
I am told that only if the variable i is public can i access it as a.i. Then what is the meaning of import. Does import give access only to public variables(that negates the meaning of public...
)
------------------
Regards,
Shree
[This message has been edited by shree vijay (edited December 23, 2000).]
[This message has been edited by shree vijay (edited December 23, 2000).]