Q:

java invoke static method from instance method & from static class call

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.

invoke static method using this.Method vs ClassName.Method
Java convention on reference to methods and variables

A:

As the conventions state (thanks to Makoto), you should refrain from using an object reference to call a static method. That means, do not do this:
someObject.staticMethod();

Instead, use the Class name like this:
SomeClass.staticMethod();

Of course, if you are calling the static method from within that class it is ok (and probably preferred) to do this:
staticMethod();

