You can call a method using myClass.myMethod() if its a static method. If its not static, you can call using myObject.myMethod() or just myMethod(). is there any other way to call it? and are there different circumstances where you can use an object to call it and call it without an object.
Share
The JVM has 4 bytecodes for calling methods:
invokestaticfor calling static methods (obviously)invokeinterfacefor calling methods on interfaces (I don’t know why they need a special bytecode, but they have one)invokespecialfor calling constructors and superclass methodsinvokevirtualfor calling all other methods