Go InterfaceGo has different approaches to implement the concepts of object-orientation. Go does not have classes and inheritance. Go fulfill these requirements through its powerful interface. Interfaces provide behavior to an object: if something can do this, then it can be used here. An interface defines a set of abstract methods and does not contain any variable. syntax: where Namer is an interface type. Generally, the name of an interface is formed by the method name plus the [e]r suffix, such as Printer, Reader, Writer, Logger, Converter, etc.
Go Interface ExampleOutput: Accelrating... I am toyota, I accelerate fast... {suzuki blue} {Toyota Red 100}
Next TopicGo Pointer
|