{"id":1476,"date":"2021-05-27T18:08:40","date_gmt":"2021-05-27T18:08:40","guid":{"rendered":"https:\/\/codeinsightacademy.com\/blog\/?page_id=1476"},"modified":"2023-08-17T14:29:31","modified_gmt":"2023-08-17T14:29:31","slug":"oops","status":"publish","type":"page","link":"https:\/\/codeinsightacademy.com\/blog\/programming\/oops\/","title":{"rendered":"OOPS"},"content":{"rendered":"\n<figure class=\"wp-block-table is-style-regular\"><table><thead><tr><th class=\"has-text-align-center\" data-align=\"center\"><strong>Major Pillars<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\"><strong>Minor Pillars<\/strong><\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">Encapsulation<br>Abstraction<br>Polymorphism<br>Hierarchy<\/td><td class=\"has-text-align-center\" data-align=\"center\">Typing<br>Persistence<br>Concurrency<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3><strong>Encapsulation<\/strong><\/h3>\n\n\n\n<p>Binding data and putting it together is called encapsulation.<\/p>\n\n\n\n<p>The process of implementing abstraction is called encapsulation.<\/p>\n\n\n\n<p>Class is the basic unit of encapsulation.<\/p>\n\n\n\n<p>Abstraction always describes outer behavior of object and encapsulation describes inner behavior of object.<\/p>\n\n\n\n<h3><strong>Abstraction<\/strong><\/h3>\n\n\n\n<p>Process of getting essential things from an object is called abstraction.<\/p>\n\n\n\n<h3><strong>Polymorphism<\/strong><\/h3>\n\n\n\n<p>Polymorphism is\u00a0<strong>the ability of any data to be processed in more than one form<\/strong>. The word itself indicates the meaning as poly means many and morphism means types.<\/p>\n\n\n\n<h3><strong>Hierarchy<\/strong><\/h3>\n\n\n\n<p>The level or ranking order of abstraction is called hierarchy.<br>There are 4 types of hierarchy<\/p>\n\n\n\n<ol><li>Composition: has-a relationship<\/li><li>Inheritance: is-a relationship<\/li><li>Dependency: use-a relationship<\/li><li>Instantiation: creates-a relationship<\/li><\/ol>\n\n\n\n<h4><strong>Inheritance<\/strong> <\/h4>\n\n\n\n<p>A journey from generalization to specialization is called inheritance.Its main purpose is to achieve <strong>re-usability<\/strong>.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2>3 minor pillars of OOPS<\/h2>\n\n\n\n<ol><li>Typing<\/li><li>Persistence<\/li><li>Concurrency<\/li><\/ol>\n\n\n\n<h3><strong>Typing<\/strong> (polymorphism)<\/h3>\n\n\n\n<p>one interface having many behaviors is called polymorphism.<\/p>\n\n\n\n<p>e.g. board can be used for writing or screen projection.<\/p>\n\n\n\n<p>USB ports can be used for a webcam or headphone or mouse.<\/p>\n\n\n\n<p>There are two types of polymorphism<\/p>\n\n\n\n<ol><li>compile time polymorphism<\/li><li>runtime polymorphism<\/li><\/ol>\n\n\n\n<h3><strong>Compile Time Polymorphism<\/strong><\/h3>\n\n\n\n<p>when the function gets called at compile time is called as compile time polymorphism also called as static binding \/ static polymorphism \/ early binding \/ weak typing \/ false polymorphism.<\/p>\n\n\n\n<h3><strong>Run Time Polymorphism<\/strong><\/h3>\n\n\n\n<p>when a call to the function gets resolved at runtime is called runtime polymorphism. It is also called dynamic binding \/ dynamic polymorphism \/ strong typing \/ true polymorphism.<\/p>\n\n\n\n<ul><li>Compile time polymorphism can be achieved by operator overloading or function overloading.<\/li><li>Runtime polymorphism can be achieved by function overriding.<\/li><\/ul>\n\n\n\n<h3>Persistence<\/h3>\n\n\n\n<p>It refers to saving data (usually to a disk) for future access.<\/p>\n\n\n\n<h3>Concurrency<\/h3>\n\n\n\n<p><strong>Concurrency<\/strong>&nbsp;refers to the potentially parallel execution of parts of a computation. In a concurrent computation, the components of a program may be executed sequentially, or they may be executed in parallel.<br>In Java concurrency is achieved by implementing Multithreading.<\/p>\n\n\n\n<p><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Major Pillars Minor Pillars EncapsulationAbstractionPolymorphismHierarchy TypingPersistenceConcurrency Encapsulation Binding data and putting it together is called encapsulation. The process of implementing abstraction is called encapsulation. Class is the basic unit of encapsulation. Abstraction always describes outer behavior of object and encapsulation describes inner behavior of object. Abstraction Process of getting essential things from an object is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":871,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/pages\/1476"}],"collection":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/comments?post=1476"}],"version-history":[{"count":18,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/pages\/1476\/revisions"}],"predecessor-version":[{"id":2857,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/pages\/1476\/revisions\/2857"}],"up":[{"embeddable":true,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/pages\/871"}],"wp:attachment":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/media?parent=1476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}