Remember, java does not have Property like C#. So you need to play a little tricky here. Adopt the property style.
When you want to access a class variable which is private, write two public methods. see the following example
class Two
{
private int var;
public int getVar()
{
return var;
}
public void setVar(int var)
{
this.var=var;
}
}
class One
{
Two objTwo=new Two();
public void oneMethod()
{
objTwo.setVar(30);
System.out.println(objTwo.getVar());
}
}
Please write your question appropriately to get appropriate answer. Hope this example helps you understand your problem.