I have a class with static method which will be invoked from same class method and from other class using Class.staticmethod. something like this,
ClassA{
public void method1(){
---
---
method2();
}
public static void method2(){
---
---
}
}
ClassB{
public void call(){
ClassA.method2(); //i have to invoke through static method.
}
}
public void main(...){
ClassA obj = new ClassA();
obj.method1();
}
Is the code follow the standard (Section 10.2 of Java conventions)? or i should invoke ClassA.method2() in classA method1. Please dont say this is a duplicate, I have looked at the other questions, they don't talk about this scenario.