# Object Oriented Programming Mechanics

- Published: March 15, 2015
- Author: William Kennedy
- URL: https://www.ardanlabs.com/blog/2015/03/object-oriented-programming-mechanics.html

<div class="p1">
Go is an object oriented programming language. It may not have inheritance, but in this 20 minute video from the Bangalore meetup, I will show you how object oriented programming practices and techniques can be applied to your Go programs. From an object oriented standpoint, Go does provides the ability to add behavior to your types via methods, allows you to implement polymorphic behavior via interfaces and gives you a way to extend the state and behavior of any existing type via type embedding. Go also provides a form of encapsulation that allows your types, including their fields and methods, to be visible or invisible. Everything you need to write object oriented programs is available in Go.</div>

<br />
<iframe allowfullscreen="" frameborder="0" height="510" src="https://www.youtube.com/embed/gRpUfjTwSOo" width="100%"></iframe>

<br />
<b><br /></b>
<b>Example 1 - Methods: </b><br />
<a href="http://play.golang.org/p/hfRkC6nKag" target="_blank"><span class="sr-only">External resource on play.golang.org: </span>http&#58;//play.golang.org/p/hfRkC6nKag</a><br />
<br />
<b>Example 2 - Interfaces:</b><br />
<a href="http://play.golang.org/p/F1UyKlTh3k" target="_blank"><span class="sr-only">External resource on play.golang.org: </span>http&#58;//play.golang.org/p/F1UyKlTh3k</a><br />
<br />
<b>Example 3 - Extending Types:</b><br />
<a href="http://play.golang.org/p/JJ811lBwoz" target="_blank"><span class="sr-only">External resource on play.golang.org: </span>http&#58;//play.golang.org/p/JJ811lBwoz</a><br />
<br />
<b>Example 4 - Overriding Inner Types:</b><br />
<a href="http://play.golang.org/p/-xQFBv9_82" target="_blank"><span class="sr-only">External resource on play.golang.org: </span>http&#58;//play.golang.org/p/-xQFBv9_82</a>
