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




RUBY - 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! Ruby satisfies almost all the features of an Object Oriented Programming (OOP) language.


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


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. Inheritance



    In simple terms, Inheritance is like a relationship between a Father and his Son. A son inherits the characteristics of his Father. Say his face, his body structure e.t.c.

  3. 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.