Object Oriented Programming with Go

Classes and Objects

Output: Area of the Rectangle is: 100.000000

Encapsulation

Output: Hello greetings John Wick
Output: cannot refer to unexported name greetings.greetInternal

Inheritance

Output: Number of Edges: 22

Interfaces

Polymorphism

Output: Area of Rectangle is: 200.000000  Area of Polygon is: 200.000000  Area of Polygon is: 100.000000

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store