Learnerslesson
   JAVA   
  SPRING  
  SPRINGBOOT  
 HIBERNATE 
  HADOOP  
   HIVE   
   ALGORITHMS   
   PYTHON   
   GO   
   KOTLIN   
   C#   
   RUBY   
   C++   




GO - OOPS


OOP (Object Oriented Programming) or OOPs (Object Oriented Programming System)


Object Oriented Programming - OOP is a concept that a programming language should be satisfying, so that the language can be called as an Object Oriented Programming (OOP) language.


Object Oriented Programming(OOP) language, as the name suggests, is a language where everything is treated as an object.


And, what exactly is an Object?


Anything and everything can be considered as an object. Be it a Human Being or a Car or a Tree or any physical object.


java_Collections

And the beauty of Object Oriented Programming (OOP) language is, it can give a virtual representation of any physical Object.


Well! Go has a little different approach using the Object Oriented Programming(OOP) . We will learn it eventually.


The basic building blocks of Object Oriented Programming (OOP) can be abbreviated as PIE. i.e. Polymorphism, Inheritance and Encapsulation.


Well! Go doesn't support Inheritance. But supports the other two.


They are listed below :

  1. Polymorphism



    Polymorphism means many forms. Which means an object can exist in various forms.Just like Animal can have many forms like Cat, Dog e.t.c. Similarly, an Animal object can also exist in various forms like Cat, Dog e.t.c. We will understand it in the next tutorial.
  2. Encapsulation



    In simple words, Encapsulation is like a capsule. The way actual medicine is protected inside a capsule. The same way all data inside a class is protected.