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
ab
You have two ways to pass object parameter to one class to another.
Passing parameter to a method
public void passMethod(ABC ab) { }
Passing parameter to a constructor
public class XYZ { public XYZ(ABC ab) { } }