{"id":17785,"date":"2023-03-07T13:15:00","date_gmt":"2023-03-07T07:45:00","guid":{"rendered":"https:\/\/www.guvi.in\/blog\/?p=17785"},"modified":"2026-09-05T16:56:28","modified_gmt":"2026-09-05T11:26:28","slug":"oops-concepts-in-java-4-basic-concepts","status":"publish","type":"post","link":"https:\/\/www.guvi.in\/blog\/oops-concepts-in-java-4-basic-concepts\/","title":{"rendered":"OOPs Concepts in Java: All 4 Pillars with Code Examples (2026)\u00a0"},"content":{"rendered":"\n<p>Ever wondered why Java is the backbone of so many enterprise applications, Android apps, and backend systems? A big part of the answer comes down to four foundational concepts: the four pillars of Object-Oriented Programming (OOPs).&nbsp;  <\/p>\n\n\n\n<p>If you&#8217;re preparing for a tech interview or just starting your Java journey, understanding these pillars isn&#8217;t optional. It&#8217;s the entry ticket.<\/p>\n\n\n\n<p>In this article, you&#8217;ll learn exactly what OOPs is, what each of the four pillars means, how they work in real Java code, and why they matter in actual software development. No draggy stuff, just clear explanations, real examples, and code you can run yourself.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>TL\/DR Summary<\/strong><\/h2>\n\n\n\n<p>Java&#8217;s OOPs is built on four pillars: <\/p>\n\n\n\n<ul>\n<li><strong>Encapsulation<\/strong> hides your data and controls access. <\/li>\n\n\n\n<li><strong>Inheritance<\/strong> lets classes reuse code from a parent class. <\/li>\n\n\n\n<li><strong>Polymorphism<\/strong> allows one method to behave differently based on context.<\/li>\n\n\n\n<li><strong>Abstraction<\/strong> hides complexity and exposes only what&#8217;s necessary.&nbsp;<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What is OOPs (Object-Oriented Programming) in Java?<\/strong><\/h2>\n\n\n\n<p><strong>Object-Oriented Programming (OOPs) in <\/strong><a href=\"https:\/\/www.guvi.in\/blog\/java-for-beginners\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Java<\/strong><\/a> is a programming paradigm that organizes code around <strong>objects<\/strong> and <strong>classes<\/strong> rather than functions and logic alone. Java is one of the most widely used OOPs languages in the world, and its entire ecosystem, from Spring Boot to Android, is built on OOPs principles.<\/p>\n\n\n\n<p>OOPs makes your code more <strong>modular, reusable, secure, and easier to maintain<\/strong>. Instead of writing one giant block of instructions, you model your program around real-world entities (objects) that have properties (data) and behaviors (methods).<\/p>\n\n\n\n<div style=\"background-color: #099f4e; border: 3px solid #110053; border-radius: 12px; padding: 18px 22px; color: #FFFFFF; font-size: 18px; font-family: Montserrat, Helvetica, sans-serif; line-height: 1.6; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); max-width: 750px;\"><strong style=\"font-size: 22px; color: #FFFFFF;\">\ud83d\udca1 Did You Know?<\/strong> <br \/><br \/><b style=\"color: #111053;\">Java<\/b> isn&#8217;t considered 100% object-oriented; it still uses primitive data types like int, char, and boolean that aren&#8217;t objects. That&#8217;s a classic interview trap!<\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><strong><em>If you want to take this further and build full Java-based applications from the ground up with mentor guidance, then check out HCL GUVI&#8217;s Certified <a href=\"https:\/\/www.guvi.in\/zen-class\/java-full-stack-development-course\/?utm_source=blog&amp;utm_medium=hyperlink&amp;utm_campaign=oops-concepts-in-java-4-basic-concepts\" target=\"_blank\" rel=\"noreferrer noopener\">Java Full Stack Developer Course<\/a>. You&#8217;ll go from OOPs fundamentals all the way to deploying real-world projects and in the end you will be getting an industry-grade certification!<\/em><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>The 2 Building Blocks: Object and Class<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1200\" height=\"628\" src=\"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/1-3.webp\" alt=\"The 2 Building Blocks: Object and Class\" class=\"wp-image-103652\" srcset=\"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/1-3.webp 1200w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/1-3-300x157.webp 300w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/1-3-768x402.webp 768w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/1-3-150x79.webp 150w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" title=\"\"><\/figure>\n\n\n\n<p>Every OOPs program in Java revolves around two core building blocks (<a href=\"https:\/\/www.enjoyalgorithms.com\/blog\/classe-and-object-in-oops\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Class and Objects<\/a>) before the four pillars even come into play.<\/p>\n\n\n\n<p>A<strong> Class<\/strong> is a blueprint. It defines what properties and behaviors an object will have, but it doesn&#8217;t occupy memory on its own. Think of it like an architectural drawing for a house.<\/p>\n\n\n\n<p>An <strong>Object<\/strong> is a real instance of that class, the actual house built from the blueprint. It lives in memory and has actual values.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Class = Blueprint\n\nclass Car {\n\n&nbsp;&nbsp;&nbsp;&nbsp;String brand;\n\n&nbsp;&nbsp;&nbsp;&nbsp;int speed;\n\n&nbsp;&nbsp;&nbsp;&nbsp;void accelerate() {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(brand + \" is accelerating at \" + speed + \" km\/h\");\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}\n\n\/\/ Object = Real Instance\n\npublic class Main {\n\n&nbsp;&nbsp;&nbsp;&nbsp;public static void main(String&#91;] args) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Car myCar = new Car(); &nbsp; &nbsp; &nbsp; \/\/ Creating an object\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myCar.brand = \"Toyota\";\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myCar.speed = 120;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myCar.accelerate();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ Output: Toyota is accelerating at 120 km\/h\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}<\/code><\/pre>\n\n\n\n<p>Simple enough, right? Now let&#8217;s get to the four pillars that make OOPs truly powerful.<\/p>\n\n\n\n<p><strong><em>If you are planning on learning OOPs through a structured self-paced course, then consider enrolling in HCL GUVI\u2019s Certified <a href=\"https:\/\/www.guvi.in\/courses\/programming\/object-oriented-programming\/?utm_source=blog&amp;utm_medium=hyperlink&amp;utm_campaign=oops-concepts-in-java-4-basic-concepts\" target=\"_blank\" rel=\"noreferrer noopener\">Object-Oriented Programming (OOPs) Course<\/a>, which is perfect for beginners looking to master OOPs fundamentals. It covers key concepts like classes, objects, inheritance, polymorphism, and design patterns.<\/em><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>The 4 OOPs Concepts in Java: Explained with Examples<\/strong><\/h2>\n\n\n\n<p>These four concepts are the heart of every <a href=\"https:\/\/www.guvi.in\/blog\/java-interview-questions-and-answers\/\" target=\"_blank\" rel=\"noreferrer noopener\">Java interview<\/a>, every <a href=\"https:\/\/www.guvi.in\/blog\/java-project-ideas-of-all-levels\/\" target=\"_blank\" rel=\"noreferrer noopener\">Java project<\/a>, and every Java framework you&#8217;ll ever work with. Let&#8217;s break each one down properly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Encapsulation: Protecting Your Data<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1200\" height=\"628\" src=\"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/2-3.webp\" alt=\"Encapsulation: Protecting Your Data\" class=\"wp-image-103653\" srcset=\"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/2-3.webp 1200w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/2-3-300x157.webp 300w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/2-3-768x402.webp 768w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/2-3-150x79.webp 150w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" title=\"\"><\/figure>\n\n\n\n<p>Encapsulation in OOPs is all about <strong>keeping your data safe from outside interference<\/strong>. You wrap your data (fields) and the methods that operate on that data inside a class, then restrict direct access using access modifiers. External code can only interact with your data through controlled methods, called <strong>getters and setters<\/strong>.<\/p>\n\n\n\n<p>Think of it like your bank account. You can check your balance and withdraw money through the ATM, but you can&#8217;t directly reach into the bank&#8217;s database and change your balance. The data is encapsulated.<\/p>\n\n\n\n<p>In Java, encapsulation is achieved by:<\/p>\n\n\n\n<ul>\n<li>Declaring class fields as private<\/li>\n\n\n\n<li>Providing public getter and setter methods to read and update those fields<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>class BankAccount {\n\n&nbsp;&nbsp;&nbsp;&nbsp;private double balance;&nbsp; \/\/ Hidden from outside world\n\n&nbsp;&nbsp;&nbsp;&nbsp;\/\/ Controlled access through getter\n\n&nbsp;&nbsp;&nbsp;&nbsp;public double getBalance() {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return balance;\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;&nbsp;\/\/ Controlled update through setter\n\n&nbsp;&nbsp;&nbsp;&nbsp;public void deposit(double amount) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (amount &gt; 0) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;balance += amount;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}\n\npublic class Main {\n\n&nbsp;&nbsp;&nbsp;&nbsp;public static void main(String&#91;] args) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BankAccount account = new BankAccount();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;account.deposit(5000);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(\"Balance: \" + account.getBalance()); \/\/ Balance: 5000.0\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ account.balance = 99999; \u2190 This would cause a compile error!\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}<\/code><\/pre>\n\n\n\n<p><strong>Why it matters:<\/strong> Encapsulation makes your code easier to maintain, debug, and test. You can change the internal implementation without breaking any code that uses the class.<\/p>\n\n\n\n<p class=\"has-text-align-center\"><em>These four pillars only really click once you write your own classes and see inheritance and polymorphism play out live. <strong>HCL GUVI&#8217;s<\/strong> <a href=\"https:\/\/www.guvi.in\/ide\/\" target=\"_blank\" rel=\"noreferrer noopener\">online IDE<\/a> lets you write, compile, and run Java code instantly, so you can experiment with the examples from this guide and build your own OOPs mini-projects.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Inheritance: Don&#8217;t Repeat Yourself<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1200\" height=\"628\" src=\"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/3-3.webp\" alt=\"Inheritance: Don&#039;t Repeat Yourself\" class=\"wp-image-103654\" srcset=\"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/3-3.webp 1200w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/3-3-300x157.webp 300w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/3-3-768x402.webp 768w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/3-3-150x79.webp 150w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" title=\"\"><\/figure>\n\n\n\n<p>Inheritance allows one class (the <strong>child<\/strong> or subclass) to inherit the properties and methods of another class (the <strong>parent<\/strong> or superclass). Instead of rewriting the same code, you build on what already exists.<\/p>\n\n\n\n<p>This is the <strong>&#8220;IS-A&#8221; relationship<\/strong> in Java. A Dog IS-A Animal. A Tesla IS-A Car. The child gets everything the parent has, plus it can add its own unique features.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Parent class\n\nclass Animal {\n\n&nbsp;&nbsp;&nbsp;&nbsp;String name;\n\n&nbsp;&nbsp;&nbsp;&nbsp;void eat() {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(name + \" is eating.\");\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}\n\n\/\/ Child class inheriting from Animal\n\nclass Dog extends Animal {\n\n&nbsp;&nbsp;&nbsp;&nbsp;void bark() {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(name + \" says: Woof!\");\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}\n\npublic class Main {\n\n&nbsp;&nbsp;&nbsp;&nbsp;public static void main(String&#91;] args) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dog dog = new Dog();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dog.name = \"Bruno\";\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dog.eat(); &nbsp; \/\/ Inherited from Animal \u2192 Bruno is eating.\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dog.bark();&nbsp; \/\/ Dog's own method \u2192 Bruno says: Woof!\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}<\/code><\/pre>\n\n\n\n<p><strong>Types of Inheritance in Java:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Type<\/strong><\/td><td><strong>Description<\/strong><\/td><td><strong>Supported in Java?<\/strong><\/td><\/tr><tr><td>Single<\/td><td>One child inherits from one parent<\/td><td>Yes<\/td><\/tr><tr><td>Multilevel<\/td><td>Child \u2192 Parent \u2192 Grandparent chain<\/td><td>Yes<\/td><\/tr><tr><td>Hierarchical<\/td><td>Multiple children from one parent<\/td><td>Yes<\/td><\/tr><tr><td>Multiple<\/td><td>One child from multiple parents<\/td><td>Not via classes (use interfaces)<\/td><\/tr><tr><td>Hybrid<\/td><td>Combination of the above<\/td><td>Not directly (use interfaces)<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\"><strong>Types of Inheritance in Java<\/strong><\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Polymorphism: One Interface, Many Forms<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1200\" height=\"628\" src=\"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/5-1.webp\" alt=\"Polymorphism\" class=\"wp-image-103655\" srcset=\"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/5-1.webp 1200w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/5-1-300x157.webp 300w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/5-1-768x402.webp 768w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/5-1-150x79.webp 150w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" title=\"\"><\/figure>\n\n\n\n<p>The word &#8220;polymorphism&#8221; literally means <em>many forms<\/em>. In Java, it means you can use a single method name to perform different tasks depending on the context. This makes your code flexible, clean, and scalable.<\/p>\n\n\n\n<p>There are two types you need to know:<\/p>\n\n\n\n<p><strong>Compile-time Polymorphism (Method Overloading)<\/strong>: The method name is the same, but the parameters differ. Java decides which version to call at compile time.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Calculator {\n\n&nbsp;&nbsp;&nbsp;&nbsp;\/\/ Same method name, different parameters\n\n&nbsp;&nbsp;&nbsp;&nbsp;int add(int a, int b) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return a + b;\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;&nbsp;double add(double a, double b) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return a + b;\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;&nbsp;int add(int a, int b, int c) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return a + b + c;\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}\n\npublic class Main {\n\n&nbsp;&nbsp;&nbsp;&nbsp;public static void main(String&#91;] args) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculator calc = new Calculator();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(calc.add(5, 3)); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ 8\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(calc.add(5.5, 3.2)); &nbsp; &nbsp; &nbsp; \/\/ 8.7\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(calc.add(1, 2, 3));&nbsp; &nbsp; &nbsp; &nbsp; \/\/ 6\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}<\/code><\/pre>\n\n\n\n<p><strong>Runtime Polymorphism (Method Overriding)<\/strong>: The child class provides a new version of a method already defined in the parent class. Java decides which version to call at runtime.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Shape {\n\n&nbsp;&nbsp;&nbsp;&nbsp;void draw() {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(\"Drawing a shape\");\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}\n\nclass Circle extends Shape {\n\n&nbsp;&nbsp;&nbsp;&nbsp;@Override\n\n&nbsp;&nbsp;&nbsp;&nbsp;void draw() {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(\"Drawing a circle\");\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}\n\nclass Rectangle extends Shape {\n\n&nbsp;&nbsp;&nbsp;&nbsp;@Override\n\n&nbsp;&nbsp;&nbsp;&nbsp;void draw() {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(\"Drawing a rectangle\");\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}\n\npublic class Main {\n\n&nbsp;&nbsp;&nbsp;&nbsp;public static void main(String&#91;] args) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shape s1 = new Circle();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shape s2 = new Rectangle();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s1.draw();&nbsp; \/\/ Drawing a circle\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s2.draw();&nbsp; \/\/ Drawing a rectangle\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}<\/code><\/pre>\n\n\n\n<p><strong>Overloading vs Overriding: Quick Comparison:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Feature<\/strong><\/td><td><strong>Method Overloading<\/strong><\/td><td><strong>Method Overriding<\/strong><\/td><\/tr><tr><td>Where<\/td><td>Same class<\/td><td>Parent &amp; Child class<\/td><\/tr><tr><td>Parameters<\/td><td>Must differ<\/td><td>Must be same<\/td><\/tr><tr><td>Return type<\/td><td>Can differ<\/td><td>Must be same (or covariant)<\/td><\/tr><tr><td>Resolved at<\/td><td>Compile time<\/td><td>Runtime<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\"><strong>Overloading vs Overriding<\/strong><\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Abstraction: Show What Matters, Hide What Doesn&#8217;t<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1200\" height=\"628\" src=\"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/6.webp\" alt=\"Abstraction\" class=\"wp-image-103656\" srcset=\"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/6.webp 1200w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/6-300x157.webp 300w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/6-768x402.webp 768w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/6-150x79.webp 150w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" title=\"\"><\/figure>\n\n\n\n<p>Abstraction is about <strong>simplifying complexity<\/strong>. You expose only the essential features of an object and hide the internal implementation details. Users of your class don&#8217;t need to know <em>how<\/em> something works, just <em>that<\/em> it works.<\/p>\n\n\n\n<p>You use an ATM every day without knowing the internal banking logic, right? That&#8217;s abstraction in real life.<\/p>\n\n\n\n<p>In Java, abstraction is achieved through two mechanisms:<\/p>\n\n\n\n<ul>\n<li><strong>Abstract Classes<\/strong>: Can have both abstract (unimplemented) and concrete (implemented) methods<\/li>\n\n\n\n<li><strong>Interfaces<\/strong>: Fully abstract by default (all methods are abstract unless marked default or static)<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Abstract class \u2014 defines the \"what\", not the \"how\"\n\nabstract class Vehicle {\n\n&nbsp;&nbsp;&nbsp;&nbsp;String brand;\n\n&nbsp;&nbsp;&nbsp;&nbsp;\/\/ Abstract method \u2014 no implementation here\n\n&nbsp;&nbsp;&nbsp;&nbsp;abstract void fuelType();\n\n&nbsp;&nbsp;&nbsp;&nbsp;\/\/ Concrete method \u2014 shared implementation\n\n&nbsp;&nbsp;&nbsp;&nbsp;void startEngine() {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(brand + \"'s engine started.\");\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}\n\nclass ElectricCar extends Vehicle {\n\n&nbsp;&nbsp;&nbsp;&nbsp;@Override\n\n&nbsp;&nbsp;&nbsp;&nbsp;void fuelType() {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(brand + \" runs on electricity.\");\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}\n\nclass PetrolCar extends Vehicle {\n\n&nbsp;&nbsp;&nbsp;&nbsp;@Override\n\n&nbsp;&nbsp;&nbsp;&nbsp;void fuelType() {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(brand + \" runs on petrol.\");\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}\n\npublic class Main {\n\n&nbsp;&nbsp;&nbsp;&nbsp;public static void main(String&#91;] args) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vehicle v1 = new ElectricCar();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;v1.brand = \"Tesla\";\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;v1.startEngine(); &nbsp; \/\/ Tesla's engine started.\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;v1.fuelType();&nbsp; &nbsp; &nbsp; \/\/ Tesla runs on electricity.\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}<\/code><\/pre>\n\n\n\n<p><strong>Abstract Class vs Interface: Know the Difference:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Feature<\/strong><\/td><td><strong>Abstract Class<\/strong><\/td><td><strong>Interface<\/strong><\/td><\/tr><tr><td>Methods<\/td><td>Abstract + Concrete<\/td><td>Abstract (+ default\/static)<\/td><\/tr><tr><td>Variables<\/td><td>Any type<\/td><td>public static final only<\/td><\/tr><tr><td>Inheritance<\/td><td>extends (single)<\/td><td>implements (multiple)<\/td><\/tr><tr><td>Constructor<\/td><td>Can have<\/td><td>Cannot have<\/td><\/tr><tr><td>Use when<\/td><td>Shared base behavior<\/td><td>Define a contract\/capability<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\"><strong>Abstract Class vs Interface<\/strong><\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>OOPs Concepts in Java: Definition, Code Example, and Real-World Analogy<\/strong><\/h2>\n\n\n\n<p>Here&#8217;s the table below covering all four pillars of OOP, along with their definitions, Java examples, and real-world analogies:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>OOPs Concept<\/strong><\/th><th><strong>Definition<\/strong><\/th><th><strong>Java Example<\/strong><\/th><th><strong>Real-World Analogy<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Encapsulation<\/strong><\/td><td>Bundling data (variables) and methods that operate on that data into a single unit (class), while restricting direct access to some of it<\/td><td><code>private double balance; public double getBalance() { return balance; }<\/code><\/td><td>A medicine capsule \u2014 the ingredients are sealed inside, and you can only access them the way the capsule allows (swallowing it), not by breaking it open directly<\/td><\/tr><tr><td><strong>Inheritance<\/strong><\/td><td>A class (child) acquiring the properties and behaviors of another class (parent), so common code doesn&#8217;t have to be rewritten<\/td><td><code>class Car extends Vehicle { }<\/code><\/td><td>A child inheriting traits from a parent \u2014 you&#8217;re born with your parents&#8217; eye color or height without having to &#8220;create&#8221; those traits yourself<\/td><\/tr><tr><td><strong>Polymorphism<\/strong><\/td><td>The same method behaving differently depending on the object calling it<\/td><td><code>Animal a = new Dog(); a.makeSound(); \/\/ Barks<\/code><\/td><td>A single button on a universal remote \u2014 pressing &#8220;power&#8221; turns on a TV, but the same button press turns on an AC when pointed at it instead<\/td><\/tr><tr><td><strong>Abstraction<\/strong><\/td><td>Hiding complex implementation details and showing only the essential features to the user<\/td><td><code>abstract class Shape { abstract void draw(); }<\/code><\/td><td>Driving a car \u2014 you use the steering wheel and pedals without needing to know how the engine or transmission works internally<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Abstraction vs Encapsulation: The Confusion Cleared<\/strong><\/h2>\n\n\n\n<p>This is one of the most commonly asked interview questions, and honestly, it trips up a lot of people. Here&#8217;s the clearest way to think about it:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><\/td><td><strong>Abstraction<\/strong><\/td><td><strong>Encapsulation<\/strong><\/td><\/tr><tr><td><strong>Focus<\/strong><\/td><td>Hiding <em>complexity<\/em><\/td><td>Hiding <em>data<\/em><\/td><\/tr><tr><td><strong>Goal<\/strong><\/td><td>Show only what&#8217;s relevant<\/td><td>Protect internal state<\/td><\/tr><tr><td><strong>Achieved via<\/strong><\/td><td>Abstract classes, Interfaces<\/td><td>Private fields, Getters\/Setters<\/td><\/tr><tr><td><strong>Real-world<\/strong><\/td><td>ATM interface hides banking logic<\/td><td>ATM PIN hidden from the screen<\/td><\/tr><tr><td><strong>Level<\/strong><\/td><td>Design level<\/td><td>Implementation level<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\"><strong>Abstraction vs Encapsulation<\/strong><\/figcaption><\/figure>\n\n\n\n<p><strong>One-liner to remember:<\/strong> Abstraction is about <em>what<\/em> an object does. Encapsulation is about <em>how<\/em> it protects what it has.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>OOPs in Java vs Python \u2014 Key Syntax Differences<\/strong><\/h2>\n\n\n\n<p>The core ideas of OOPs stay the same across languages, but Java and Python express them quite differently \u2014 one leans on strict rules and explicit syntax, the other keeps things loose and readable. Here&#8217;s a side-by-side look:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Aspect<\/strong><\/th><th><strong>Java<\/strong><\/th><th><strong>Python<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Class Declaration<\/strong><\/td><td><code>class Car { }<\/code> \u2014 requires a file name to match the public class name<\/td><td><code>class Car:<\/code> \u2014 no matching filename requirement, indentation defines the body<\/td><\/tr><tr><td><strong>Constructor<\/strong><\/td><td>Uses a method named exactly after the class: <code>public Car() { }<\/code><\/td><td>Uses a fixed special method: <code>def __init__(self):<\/code><\/td><\/tr><tr><td><strong>Access Modifiers (Encapsulation)<\/strong><\/td><td>Enforced by the compiler using <code>private<\/code>, <code>protected<\/code>, <code>public<\/code> keywords<\/td><td>Convention-based only \u2014 a single underscore <code>_var<\/code> signals &#8220;protected,&#8221; double underscore <code>__var<\/code> triggers name-mangling; nothing is truly enforced<\/td><\/tr><tr><td><strong>Inheritance Syntax<\/strong><\/td><td><code>class ElectricCar extends Car { }<\/code><\/td><td><code>class ElectricCar(Car):<\/code><\/td><\/tr><tr><td><strong>Method Overriding (Polymorphism)<\/strong><\/td><td>Requires matching method signature; <code>@Override<\/code> annotation is optional but recommended for clarity<\/td><td>No annotation needed \u2014 just redefine the method with the same name in the child class<\/td><\/tr><tr><td><strong>Abstraction<\/strong><\/td><td>Needs an explicit <code>abstract class<\/code> or <code>interface<\/code> keyword, with abstract methods left unimplemented<\/td><td>Uses the <code>abc<\/code> module \u2014 inherit from <code>ABC<\/code> and mark methods with <code>@abstractmethod<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>OOPs Interview Questions in Java \u2014 Top 20 Asked at Product Companies<\/strong><\/h2>\n\n\n\n<p><em>Before going through the questions below: product-based companies rarely stick to a fixed question bank \u2014 interviewers frame their own variations to test real understanding, not memorized answers.<\/em><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. What is OOPs in Java, and why do we use it over procedural programming? <\/strong><\/h3>\n\n\n\n<p>It&#8217;s a programming approach built around objects instead of functions and logic. Interviewers want you to say it makes code reusable, scalable, and easier to maintain \u2014 not just recite the four pillars.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Can you explain the four pillars of OOPs with a real project example, not just theory?<\/strong> <\/h3>\n\n\n\n<p>This is where bookish answers fail. They want you to map encapsulation, inheritance, polymorphism, and abstraction to something you&#8217;ve actually built \u2014 like a payment module or a user authentication system.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. What&#8217;s the difference between a class and an object?<\/strong> <\/h3>\n\n\n\n<p>Class is the blueprint, object is the actual instance created from it \u2014 but be ready for the follow-up: &#8220;how many objects can one class create?&#8221;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Why is Java not considered 100% object-oriented?<\/strong> <\/h3>\n\n\n\n<p>Because of primitive data types like <code>int<\/code>, <code>char<\/code>, <code>boolean<\/code> \u2014 they aren&#8217;t objects, unlike everything in Python.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5. What&#8217;s the difference between method overloading and overriding?<\/strong> <\/h3>\n\n\n\n<p>Overloading happens at compile-time within the same class with different parameters; overriding happens at runtime between parent and child classes with the same signature.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6. Can you override a static method in Java?<\/strong> <\/h3>\n\n\n\n<p>No \u2014 static methods belong to the class, not the object, so they get hidden, not overridden. This trips up a lot of candidates.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>7. What is constructor overloading, and why can&#8217;t constructors be overridden?<\/strong> <\/h3>\n\n\n\n<p>Constructors can have multiple versions with different parameters (overloading), but they can&#8217;t be overridden since they aren&#8217;t inherited.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>8. Why does Java not support multiple inheritance with classes?<\/strong> <\/h3>\n\n\n\n<p>To avoid the diamond problem \u2014 ambiguity when two parent classes have the same method. Java gets around this using interfaces instead.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>9. What&#8217;s the difference between an abstract class and an interface?<\/strong> <\/h3>\n\n\n\n<p>Abstract classes can have both implemented and unimplemented methods; interfaces (pre-Java 8) could only have method declarations. Post-Java 8, interfaces can have default and static methods too \u2014 expect this nuance to be tested.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>10. If interfaces can now have default methods, what&#8217;s the real difference left between abstract classes and interfaces?<\/strong> <\/h3>\n\n\n\n<p>Abstract classes support constructors and instance variables with state; interfaces still can&#8217;t maintain object state the same way.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>11. What is encapsulation actually protecting against?<\/strong> <\/h3>\n\n\n\n<p>Uncontrolled or accidental modification of an object&#8217;s internal state from outside code \u2014 not just &#8220;hiding data&#8221; as a vague concept.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>12. Why do we make instance variables private and expose getters and setters?<\/strong> <\/h3>\n\n\n\n<p>To control how the variable is read or updated \u2014 you can add validation logic inside the setter instead of allowing direct, unchecked access.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>13. What is the &#8220;is-a&#8221; and &#8220;has-a&#8221; relationship in OOPs?<\/strong> <\/h3>\n\n\n\n<p>&#8220;Is-a&#8221; represents inheritance (a Car is a Vehicle); &#8220;has-a&#8221; represents composition (a Car has an Engine). Interviewers often ask when to prefer one over the other.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>14. Why is composition often preferred over inheritance in real-world design?<\/strong> <\/h3>\n\n\n\n<p>Because inheritance creates tight coupling between classes \u2014 changes in the parent class can break child classes unexpectedly. Composition keeps things more flexible.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>15. What is runtime polymorphism, and how does the JVM implement it internally?<\/strong> <\/h3>\n\n\n\n<p>Also called dynamic method dispatch \u2014 the JVM decides which overridden method to call based on the actual object type at runtime, not the reference type.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>16. Can a constructor be private in Java? What&#8217;s the use case?<\/strong> <\/h3>\n\n\n\n<p>Yes \u2014 commonly used in Singleton design pattern implementations, where you want to control and restrict object creation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>17. What happens if a subclass doesn&#8217;t implement all abstract methods of its parent?<\/strong> <\/h3>\n\n\n\n<p>The subclass itself must be declared abstract too, otherwise it won&#8217;t compile.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>18. What is the difference between abstraction and encapsulation, in one line an interviewer would accept?<\/strong> <\/h3>\n\n\n\n<p>Abstraction hides complexity in design (what to show), encapsulation hides data in implementation (how to protect it).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>19. Why does Java use <code>super<\/code> keyword, and where can it be used?<\/strong> <\/h3>\n\n\n\n<p>To access parent class methods, constructors, or variables when a child class overrides or hides them.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>20. How would you design a class hierarchy for a real system \u2014 say a food delivery app \u2014 using all four OOPs pillars?<\/strong> <\/h3>\n\n\n\n<p>This is a design-thinking question. They&#8217;re checking if you can apply OOPs concepts to a live problem, not just define them \u2014 expect to sketch classes like <code>Order<\/code>, <code>Restaurant<\/code>, <code>DeliveryPartner<\/code>, and justify your inheritance\/composition choices out loud.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>In conclusion, OOPs isn&#8217;t just a theoretical concept you mug up for interviews and forget. It&#8217;s the <strong>practical architecture<\/strong> of every Java application built at scale. You now understand what Encapsulation, Inheritance, Polymorphism, and Abstraction really mean: not just in definition, but in actual working code.<\/p>\n\n\n\n<p>The best way to truly lock these in? Build something. Take any small real-world scenario, a library system, a vehicle management app, or a simple banking program, and implement it using all four OOPs pillars. You&#8217;ll be surprised how quickly the concepts click.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>FAQs<\/strong><\/h2>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1772175372995\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>1. What are the 4 pillars of OOPs in Java?<\/strong>\u00a0<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>The four pillars are Encapsulation (data hiding through access modifiers), Inheritance (reusing code via parent-child class relationships), Polymorphism (one method, multiple behaviors through overloading and overriding), and Abstraction (hiding complexity through abstract classes and interfaces).<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1772175376089\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>2. What is the difference between abstraction and encapsulation in Java?<\/strong>\u00a0<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Abstraction hides complexity at the design level using abstract classes and interfaces. Encapsulation hides data at the implementation level using private fields and getter\/setter methods. Abstraction is about <em>what<\/em> an object does; encapsulation is about <em>how<\/em> it protects its data.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1772175381487\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>3. What are the types of polymorphism in Java?<\/strong>\u00a0<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Java supports two types: compile-time polymorphism (method overloading, same method name, different parameters) and runtime polymorphism (method overriding, child class redefines a parent class method).<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1772175385786\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>4. What are the types of inheritance in Java?<\/strong>\u00a0<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Java supports single, multilevel, and hierarchical inheritance through classes. Multiple and hybrid inheritance are achieved through interfaces, since Java doesn&#8217;t allow a class to extend multiple classes.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1772175393653\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>5. Is Java 100% object-oriented?<\/strong>\u00a0<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>No. Java uses primitive data types (int, char, boolean, float, etc.) that are not objects. This makes Java not purely object-oriented. However, Java provides wrapper classes (like Integer, Character) to treat primitives as objects when needed.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Ever wondered why Java is the backbone of so many enterprise applications, Android apps, and backend systems? A big part of the answer comes down to four foundational concepts: the four pillars of Object-Oriented Programming (OOPs).&nbsp; If you&#8217;re preparing for a tech interview or just starting your Java journey, understanding these pillars isn&#8217;t optional. It&#8217;s [&hellip;]<\/p>\n","protected":false},"author":64,"featured_media":137323,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37,294,720],"tags":[],"views":"18815","authorinfo":{"name":"Abhishek Pati","url":"https:\/\/www.guvi.in\/blog\/author\/abhishek-pati\/"},"thumbnailURL":"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2023\/03\/oops-concepts-in-Java-300x116.webp","_links":{"self":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts\/17785"}],"collection":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/users\/64"}],"replies":[{"embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/comments?post=17785"}],"version-history":[{"count":56,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts\/17785\/revisions"}],"predecessor-version":[{"id":137324,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts\/17785\/revisions\/137324"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/media\/137323"}],"wp:attachment":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/media?parent=17785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/categories?post=17785"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/tags?post=17785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}