Embedded interfaces allow for _____ in Go.

  • inheritance
  • polymorphism
  • encapsulation
  • abstraction
Embedded interfaces in Go allow for polymorphism. When an interface is embedded within another interface or struct, the methods of the embedded interface become part of the embedding interface. This enables polymorphism, where different types can implement the same set of methods defined by the embedded interface. This is a fundamental concept in Go's type system and allows for flexibility and code reuse.
Add your answer
Loading...

Leave a comment

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