In Java, this is not possible! It's not like an object oriented language works fine, right?
Just stop for a second and rethink the nature of the static java method. It is assumed that the class is a plan for objects, describes their behavior and state. But you can call the static method without creating any instances.
How does this fit into an object-oriented picture? How does a static method "belong" to the class in which it was declared?
In fact, static methods are a hack in Java, they pollute and misuse the concept of an OOP class. But you have become accustomed to them for many years so that you no longer feel this.
Conceptually, the static method is a top-level function, and Java uses the name of its declaration class as its namespace. In contrast, Kotlin allows you to declare top-level functions without misusing the class for the namespace.
source share