If by sharing you mean access to the values of object1 and object2 anywhere in the code then these variables should be static, if you mean that once you have initialized ClassA in your code and you want to access to object1 and object2 then the variables should be public.
Is that what you mean by sharing?
Clarification:
Then the members object1 and object2 must be static, but if you want to keep the private you should declare those variables in a abstract class and ClassA and ClassB inherit that class.
public abstract class ClassAB{
protected SharableClass object1;
protected SharableClass object2;
}
public class ClassA extends ClassAB{
//Change object1 and object2 (changes are applied in all ClassAB)
}
public class ClassB extends ClassAB{
//Change object1 and object2 (changes are applied in all ClassAB)
}