Is there a way to call a function outside a class? I don't know how to say it but I have an example.
class Class1{
class Class2{
public void callFunctionInC1(){
//how can I call funtionNeedtoBeCalled
}
}
public Class1(){
Class2 c2 = new Class2();
c2.callFunctionInC1();
}
public void functionNeedtoBeCalled(){
//do something
}
}
It sounds weird but I do have a reason to do that. Is there anyway to do that? Thanks.