In Go, an interface is defined using the _____ keyword.

  • interface{}
  • protocol{}
  • interface
  • implements
In Go, an interface is defined using the interface keyword. Interfaces define a set of methods that a concrete type must implement to satisfy the interface. It is important to note that unlike some other languages, Go interfaces are implicit, meaning that you don't need to explicitly declare that a type implements an interface. Any type that implements the methods defined by an interface is automatically considered to satisfy that interface.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *