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

  • interface
  • abstract
  • implements
  • extends
In Go, an interface is defined using the interface keyword. An interface in Go specifies a set of method signatures that a type must implement. This allows for polymorphism and loose coupling, as different types can satisfy the same interface as long as they implement the required methods. The interface keyword is a fundamental construct in Go for achieving abstraction and defining contracts.
Add your answer
Loading...

Leave a comment

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