- Define an interface that contains the method String getData(String s1, String s2, String s3) (call it Callback, for exmple)
- Make class A implement that interface
- Make the updateList method in class B take a variable of the interface type as an argument
- In the updateList method of class B call the getData method on that argument variable
Chandra shekar M wrote:But how Does class B passin the required arguments for getData().
What do you mean exactly? How the updateList method of class B gets the values for s1, s2, s3 that it should pass to the getData() method? It must have some way to get these; maybe you should add them as arguments to the updateList method of class B, so that it can pass them to getData().