I am working with Apex inner classes and I got the limitation described below
I can't name a method in my inner class with the same name I used in a static method in the containing class
When I do that I got this error
myClass.myInnerClass: Instance method clashes with static method: myMethod(): from: myClass
Code example
public class MyClass{
public static void myMethod(){
// outer myMethod code
}
public class MyInnerClass{
public void myMethod(){
// inner myMethod code
}
}
}
I don't understand the clashes between the two methods, because from what I know
The outer method can be called like this : MyClass.myMethod()
The inner method can be called like this : (new MyClass.MyInnerClass()).myMethod()
Do you have more info about this limitation of the language ?