I have 2 non-static classes. I need to access a method on one class in order to return an object for processing. But since both classes are non-static, I can't just call the method in a static way. Also, you cannot call the method in a non-stationary way, because the program does not know the identifier of the object.
Before anything, if possible, I would like both objects to remain unstable, if possible. Otherwise, a major restructuring of the rest of the code would be required.
Here is a sample code
class Foo { Bar b1 = new Bar(); public object MethodToCall(){ } } Class Bar { public Bar() { } public void MethodCaller() {
source share