Structs in Go support _____ which allows you to extend or compose types.

  • Inheritance
  • Encapsulation
  • Composition
  • Abstraction
In Go, structs support composition, which allows you to create complex types by embedding other types (structs or interfaces) within a struct. This is a powerful feature that enables code reuse and modularity without the complexities of traditional inheritance. It promotes a more flexible and maintainable design in Go.
Add your answer
Loading...

Leave a comment

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