Restricting access to package private variables when the package is used in other package
<p>company xyz created a package</p>

<pre><code>com.xyz.utils.
</code></pre>

<p>There are two classes declared in two separate files. They have some variables as package private. so that a variable X in class A can be used in class B of the same package.</p>

<pre><code>package com.xyz.utils;
public class A{
int a=10;
}

package com.xyz.utils;
public class B{
int b = (new A()).a;
}
</code></pre>

<p>Those two files are compiled into a jar and sent to customer.</p>

<p>The customer add the jar to the project he is building and he writes code like below</p>

<pre><code>package com.xyz.utils;

public  class customer_class
{
     int  Y = (new A()).a;
}
</code></pre>

<p>Is that above code is correct?</p>

<p>My quetsion is. how can we make variables which are declared as package private to be not visible to others when they use the package.</p>
