note that the Scala compiler actually creates a new synthetic class called A$ for the singleton object A, so the line A.staticMethod calls the method on a single instance of A$ which exists at runtime.

Noteworthy: The Scala compiler also creates a static method staticMethod in A on the bytecode level which forwards the call to A$.staticMethod - in case you're mixing Java and Scala code in your project, this means that you will also be able to call this static method from Java like this:

// Java
A.staticMethod(); // works

However, if you declare the method with the same name in the companion class A, while everything still works in the same way in Scala, the static forwarder method in A will not be generated, and you will not be able to call staticMethod from Java: