An interface in Go is a collection of _______.

  • data types
  • functions
  • methods
  • variables
In Go, an interface is defined as a collection of method signatures. It specifies what methods a type must have to implement that interface, but it does not contain any implementation itself. This enables polymorphism in Go, allowing different types to be treated interchangeably if they satisfy the interface contract.
Add your answer
Loading...

Leave a comment

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