I don’t know how interface works for my problem but I have read that its possible by interface here
Problem: I have created an interface which has All the declaration of the methods its around 3000+ I am implementing these methods in 3 different classes, now I want to call the methods from Interface in my main file, reason I can need any method from any class and I cant extend more than one class so i thought about using interface.
Can I do this Answers are appreciated.
Update: using extend I can use super.methodName(); So that i am not creating an object.
I can split these methods in different interfaces or different classes but I must access the methods without creating the object Please the link to understand what i want to do.
Update2: Interface ABC // public int go() function is declared here
Class XYZ implements ABC
method go(object imp)
{.....}
Another class
Class PQR extends/implements ABC
{
// some code
int ret = super.go(this); OR int ret = obj.go(this)
} // What Should I use I now ABC is my interface but dont know where is it implemented so i want to call the go function how can I do this Please Explain what should i use.
Thanks
When you call a method on an interface, it actually calls the implementing method on the concrete class. It doesn’t matter that you have an insane number of methods or how many classes you have. e.g.
BTW: There is only a relatively small number of classes which have 3000 lines, let alone 3000 methods. I assume this is generated code.