For all extensive purposes, they are syntactic sugar, so the static method seems more like OOP. There is no inheritance because static methods in Java and Groovy do not participate in inheritance (that is, classes do not inherit static methods).
Methods must be static because the compiler does not know how to instantiate the surrounding extension method class.
However, I believe that there are languages โโthat allow you to define methods outside the surrounding class and perform some kind of inheritance, but not many of them (I believe that CLOS and Dylan do). In addition, they represent many languages โโthat seem to allow methods to be added, but the type of โobjectโ is actually changed / hidden for some other type. This is called adhock polymorphism (e.g. Clojure, Haskell, like Golang and a kind of Scala), but again has nothing to do with inclusive polymorphism (Java inheritance).
source share