I created an instance of a class in java as following:
ABC ab = new ABC();
I want to access this instant ab in another class
I know this question is old, but If I'm correct you want to transfer an Object into another class to be used.
In order to do that you need a few things
Class XYZ has to have a constructor to take in the parameter "Object" it would something like
class XYZ{
private Object ab
public XYZ(Object ab){
this.ab = ab;//This is the constructor called when you create an XYZ object, and want to use the Object ab in XYZ
}