Or what is the interface that all types implement?
I'm looking for something like the Object
class in Java.
Is it possible for me to make my own kind of "Root" interface?
Or what is the interface that all types implement?
I'm looking for something like the Object
class in Java.
Is it possible for me to make my own kind of "Root" interface?
Any type that implements all the methods listed in the interface implements the interface.
The empty interface, interface{}
, lists no methods. Therefore, all types implement it.
There is nothing "top level" about it however. Interfaces (although they can embed) do not have a hierarchical structure. The empty interface is simply a normal interface with no requirements.