{"id":68629,"date":"2020-10-28T10:22:32","date_gmt":"2020-10-28T10:22:32","guid":{"rendered":"https:\/\/www.fita.in\/?p=68629"},"modified":"2023-10-09T12:44:58","modified_gmt":"2023-10-09T12:44:58","slug":"oops-in-java","status":"publish","type":"post","link":"https:\/\/www.fita.in\/oops-in-java\/","title":{"rendered":"OOPs In JAVA: Object Oriented Programming Concepts With Examples In Java"},"content":{"rendered":"
\r\nIn this, we understand the Object-Oriented Programming (OOP) paradigm of Java, deeply with this table of content\u2026\r\n
\r\n
\r\n\r\n<\/i> What is Object-Oriented Programming and Other Programming Paradigm\r\n
\r\n
<\/i> Classes in Java<\/div>\r\n
<\/i> Objects in Java<\/div>\r\n
\r\n\r\n<\/i> Methods in Java\r\n
\r\n
<\/i> Static and Non Static methods in Java<\/div>\r\n
<\/i> Getter and Setter Methods in Java<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n
\r\n\r\n<\/i> Major Concepts or Principles Of Object Oriented Programming In Java\r\n
\r\n
<\/i> Inheritance in Java<\/div>\r\n
<\/i> Polymorphism in Java<\/div>\r\n
<\/i> Data Abstraction In Java<\/div>\r\n
<\/i> Encapsulation in Java<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n

What is Object-Oriented Programming and Other Programming Paradigms<\/strong><\/h3>\r\n

Object-oriented programming System(OOPs) is a programming concept based on the objects that interact with each other to perform the functions. Each object can be characterized with behavior and states. An object keeps the current state and the behavior in the fields and methods. It emphasizes the DRY(Don\u2019t Repeat Yourself) Principle.<\/p>\r\n

For instance, an object could represent an email with properties like subject, title, body, and behaviors such as attachments, sending, organizing.<\/p>\r\n

OOPs categorizes entities as software objects that have some data associated with them to perform operations upon.<\/p>\r\n

Another common programming concept is Procedural Oriented Programming(POP), which structures a program like a food recipe that provides a finite number of steps, in the form of functions or code blocks, that flow sequentially in order to get the final result.<\/p>\r\n

Almost all the programming languages follow Object Oriented Programming System including Java, let us now jump to the concepts of OOPs in java.<\/p>\r\n\r\n

Major OOPs Concepts In Java<\/strong><\/h3>\r\n
\r\n
<\/i> Classes<\/div>\r\n
<\/i> Objects<\/div>\r\n
<\/i> Methods<\/div>\r\n
<\/i> Inheritance<\/div>\r\n
<\/i> Polymorphism<\/div>\r\n
<\/i> Data Abstraction<\/div>\r\n
<\/i> Encapsulation<\/div>\r\n<\/div>\r\n

Classes In Java<\/strong><\/h3>\r\n

A class defines the attributes and behavior of an object. For example, if you have an Employee class, it can have attributes like name, salary, and age, whereas its behavior can include functions such as deduct or increment salary or calculate bonus, etc.<\/p>\r\n

Hope you understood Classes in java, <\/em>next major concept of object-oriented programming is the Objects in Java.<\/em><\/p>\r\n\r\n

Objects In Java<\/strong><\/h3>\r\nObjects are the instances of classes or derived attributes and behaviors from class with actual data.\r\n\r\nHere is an example program for demonstrating classes and objects in java.\r\n
\r\n
\r\npublic class Main {\r\n\r\nint val_1 = 22;\r\n\r\nint val_2 = 32;\r\n\r\npublic static void main(String[] args) {\r\n\r\n\/\/ creating multiple objects for the class main\r\n\r\nMain obj_1 = new Main();\r\n\r\nMain obj_2 = new Main();\r\n\r\nSystem.out.println(obj_1.val_1);\r\n\r\nSystem.out.println(obj_2.val_2);\r\n\r\n}\r\n\r\n}\r\n<\/code><\/pre>\r\n<\/div>\r\nOutput for the above program<\/strong>\r\n
\r\n
\r\n22\r\n\r\n32\r\n<\/code><\/pre>\r\n<\/div>\r\nHope you understood Objects in java, <\/em>next major concept of object oriented programming is the Methods in Java.<\/em>\r\n

Methods In Java<\/strong><\/h3>\r\nFunctions underclasses are known as methods. They define the behavior of a class.\r\n\r\nHere is an example for implementing methods under classes\u2026\r\n
\r\n
\r\nimport java.io.*;\r\n\r\npublic class Main {\r\n\r\nstatic void method(String x) {\r\n\r\nSystem.out.println(\"Hello From \"+x+ \"!\");\r\n\r\npublic static void main(String[] args) {\r\n\r\nmethod(\"Atufa\");\r\n\r\n}\r\n<\/code><\/pre>\r\n<\/div>\r\nOutput for the above program<\/strong>\r\n
\r\n
\r\nHello From Atufa!\r\n<\/code><\/pre>\r\n<\/div>\r\nYou might have noticed that we use static or public access specifiers before the method name, let us understand static and public methods in Java.<\/em>\r\n

Static and non Static methods in Java<\/strong><\/h3>\r\n

In java, methods and classes are usually defined with static or public access modifiers.Defining methods or classes using static keywords makes them static, meaning they can be accessed outside the classes without creating an object for them.<\/p>\r\n

Hope you understood Methods in java well, <\/em>the next major concept of object-oriented programming is the Inheritance in Java.<\/em><\/p>\r\n\r\n

Inheritance In Java<\/strong><\/h3>\r\n

You might have some inheritance or resemblance of behaviours in you like your parents.Just like this, you can inherit properties of one class from another.The newly inherited class is a derived or child class and the former as base or Parent class.<\/p>\r\n

Example Program\u00a0 for\u00a0 Inheritance implementation<\/p>\r\n\r\n

\r\n
\r\nimport java.io.*;\r\n\r\nclass Main {\r\n\r\n\/\/ Main attribute\r\n\r\nprotected String writer = \"AL Sweigart\";\r\n\r\n\/\/ Main method\r\n\r\npublic void famousBook() {\r\n\r\nSystem.out.println(\"Automate the boring stuff with python\");\r\n\r\n}\r\n\r\n}\r\n\r\nclass Author extends Main {\r\n\r\nprivate int books = 22; \/\/ Author attribute\r\n\r\npublic static void main(String[] args) {\r\n\r\n\/\/ Create a Author object\r\n\r\nAuthor Book = new Author();\r\n\r\n\/\/ Call the famousBook() method (from the Main class) on the Book object\r\n\r\nBook.famousBook();\r\n\r\n\/\/ Display the value of the writer attribute (from the Main class) and the\r\n\r\n\/\/ number of the books from the Author class\r\n\r\nSystem.out.println(Book.writer + \" \" + Book.books);\r\n\r\n}\r\n\r\n}\r\n<\/code><\/pre>\r\n<\/div>\r\n

The Main class is the super class, whereas the Author is the derived or child class of Main.The main method famous book can be accessed by any derived class as it is defined as public.<\/p>\r\n

Here we just needed to add another attribute and method and the rest of the attributes and methods are added to the child class by adding the extends to class name Author and defining main() method.<\/p>\r\nThe output for the above program will be\r\n

\r\n
\r\nAutomate the boring stuff with python\r\n\r\nAL Sweigart 22\r\n<\/code><\/pre>\r\n<\/div>\r\n
\r\n
<\/i> The final keyword<\/div>\r\n<\/div>\r\nTo make a class not to be inherited by any other class, we can add the final keyword to the class name.\r\n
\r\n
\r\nimport java.io.*;\r\n\r\nfinal class Main {\r\n\r\n\/\/ Main attribute\r\n\r\nprotected String writer = \"AL Sweigart\";\r\n\r\n\/\/ Main method\r\n\r\npublic void famousBook() {\r\n\r\nSystem.out.println(\"Automate the boring stuff with python\");\r\n\r\n}\r\n\r\nclass Author extends Main { \/\/ this line will cause an error\r\n\r\nprivate int books = 22;\r\n\r\npublic static void main(String[] args) {\r\n\r\nAuthor Book = new Author();\r\n\r\nBook.famousBook();\r\n\r\nSystem.out.println(Book.writer + \" \" + Book.books);\r\n\r\n}\r\n<\/code><\/pre>\r\n<\/div>\r\nWhich will give an error as\r\n
\r\n
\r\nprog.java:13: error: cannot inherit from final Main\r\n<\/code><\/pre>\r\n<\/div>\r\nThe different types of inheritance are single-level, multi-level and hierarchical inheritance.\r\n\r\nHope you understood Inheritance in java well, <\/em>the next major concept of object oriented programming is the Polymorphism in Java.<\/em>\r\n

Polymorphism In Java<\/strong><\/h3>\r\nPolymorphism is when you use a class method in different ways or in more than one way.There are two types of polymorphism\r\n
\r\n
<\/i> Run-time Polymorphism<\/div>\r\n
<\/i> Compile-time Polymorphism<\/div>\r\n<\/div>\r\nHere is an example of a program to have a better understanding of Polymorphism..\r\n
\r\n
\r\nimport java.io.*;\r\n\r\nclass Shape {\r\n\r\npublic void area() {\r\n\r\nSystem.out.println(\"Geometrical shapes\");\r\n\r\n}\r\n\r\nclass Circle extends Shape {\r\n\r\npublic void area() {\r\n\r\nSystem.out.println(\"pi*radius*radius\");\r\n\r\n}\r\n\r\nclass Triangle extends Shape {\r\n\r\npublic void area() {\r\n\r\nSystem.out.println(\"half*base*height\");\r\n\r\n}\r\n\r\nclass Main {\r\n\r\npublic static void main(String[] args) {\r\n\r\n\/\/ create shape object\r\n\r\nShape Shape = new Shape();\r\n\r\nShape Circle = new Circle(); \/\/ Create a Circle object\r\n\r\nShape Triangle = new Triangle(); \/\/ Create a Triangle object\r\n\r\nSystem.out.println(\"calling Shape method area\");\r\n\r\nShape.area();\r\n\r\nSystem.out.println();\r\n\r\nSystem.out.println(\"calling Circle method area\");\r\n\r\nCircle.area();\r\n\r\nSystem.out.println();\r\n\r\nSystem.out.println(\"calling Triangle method area\");\r\n\r\nTriangle.area();\r\n\r\n}\r\n<\/code><\/pre>\r\n<\/div>\r\n

In the above code, the class Shape is the Base class whereas Circle and Triangle are the derived or sub classes. The same method area works differently in all the classes, it returns the area of different shapes.<\/p>\r\nThe output for the above example\r\n

\r\n
\r\ncalling Shape method area\r\n\r\nGeometrical shapes\r\n\r\ncalling Circle method area\r\n\r\npi*radius*radius\r\n\r\ncalling Triangle method area\r\n\r\nhalf*base*height\r\n<\/code><\/pre>\r\n<\/div>\r\n

Check out this Complete Online Java Course<\/a> by FITA Academy<\/a>. FITA provides a complete Java course including core java and advanced java J2EE, and SOA training, where you will be building real-time applications using Servlets, Hibernate Framework,<\/em> and Spring <\/em>with Aspect Oriented Programming (AOP) architecture, Struts through JDBC<\/em> bundled with, placement support, and certification at an affordable price with an active placement cell,by expert software developers with 10+ years of experience in the field to make you an industry required certified java developer.<\/p>\r\n\r\n

Getter and Setter method In Java<\/strong><\/h3>\r\n

The attributes defined as private cannot be accessed outside the class, or the base class in case of inheritance.We will need public methods which can have access to the private attributes to retrieve or set the value of private attributes.<\/p>\r\n

Hope you understood Polymorphism in java well, <\/em>the next major concept of object-oriented programming is the Encapsulation in Java.<\/em><\/p>\r\n\r\n

Encapsulation In Java<\/strong><\/h3>\r\nEncapsulation in simple terms is to make the methods and attributes private or protected and give a level of security to be accessed outside the class.\r\n\r\nThe keywords public, private and protected are used to give a defined level of access outside the class.\r\n\r\nExample program for Encapsulation.\r\n
\r\n
\r\npublic class Encapsulation {\r\n\r\n\/* private variables can only be accessed by public methods of same class *\/\r\n\r\nprivate String nickName;\r\n\r\nprivate String habit;\r\n\r\nprivate int age;\r\n\r\n \r\n\r\n\/* getter method for accessing private variable age *\/\r\n\r\npublic int get_age() {\r\n\r\nreturn age;\r\n\r\n\/* getter method for accessing private variable nickname *\/\r\n\r\npublic String get_name() {\r\n\r\nreturn nickName;\r\n\r\n\/* getter method for accessing private variable habit *\/\r\n\r\npublic String get_habit() {\r\n\r\nreturn habit;\r\n\r\n\/* setter method for setting value for private variable age *\/\r\n\r\npublic void set_age(int newAge) {\r\n\r\nage = newAge;\r\n\r\n\/* setter method for setting value for private variable age *\/\r\n\r\npublic void set_name(String newName) {\r\n\r\nnickName = newName;\r\n\r\n\/* setter method for setting value for private variable age *\/\r\n\r\npublic void set_habit(int newHabit) {\r\n\r\nhabit = newHabit;\r\n\r\n}\r\n<\/code><\/pre>\r\n<\/div>\r\nNow to test this class for encapsulation, in another file encaptest.java we will have this code,\r\n
\r\n
\r\npublic class encaptest {\r\n\r\npublic static void main(String[] args) {\r\n\r\nEncapsulation obj = new Encapsulation();\r\n\r\n\/\/ setting values of the variables\r\n\r\nobj.set_name(\"Atufa\");\r\n\r\nobj.set_habit(\"Writing content for geeks..\");\r\n\r\nobj.set_age(18);\r\n\r\n\/\/ Displaying values of the variables\r\n\r\nSystem.out.println(\"Writer's name: \" + obj.get_name());\r\n\r\nSystem.out.println(\"Writer's age: \" + obj.get_age());\r\n\r\nSystem.out.println(\"Writer's habit: \" + obj.get_habit());\r\n\r\n\/*\r\n\r\n* Direct access of habit is not possible due to encapsulation\r\n\r\n* System.out.println(\"Writer's habit: \" + obj.habit);\r\n\r\n*\/\r\n\r\n}\r\n<\/code><\/pre>\r\n<\/div>\r\nOutput for the above program is\r\n
\r\n
\r\nWriter\u2019s name: Atufa\r\n\r\nWriter\u2019s age: 18\r\n\r\nWriter\u2019s habit: Writing content for geeks..\r\n<\/code><\/pre>\r\n<\/div>\r\nHope you understood Encapsulation in java well, <\/em>the next major concept of object oriented programming is the Data Abstraction in Java.<\/em>\r\n

Data Abstraction<\/strong><\/h3>\r\n

Abstraction is where in the user is kept unaware of the code that is used for implementation, for instance, when you are buying a brand new phone, it is one thing for you, although there are many individual parts in this. \u00a0Abstraction allows users to use the phone\u00a0 without knowing the complexity of the parts that form the phone.<\/p>\r\n

In java you can make a class abstract by just prefixing the class name with the abstract keyword.<\/p>\r\n

An abstract method can be declared in the super class with an abstract keyword, and defined under any subclass.<\/p>\r\n

Here is an example program for abstraction<\/p>\r\n\r\n

\r\n
\r\nimport java.io.*;\r\n\r\n\/\/ An Abstract class\r\n\r\nabstract class Shape {\r\n\r\n\/\/ Abstract method (does not have a body)\r\n\r\npublic abstract void area();\r\n\r\n\/\/ Regular method\r\n\r\npublic void property() {\r\n\r\nSystem.out.println(\"A geometrical Shape\");\r\n\r\n}\r\n\r\n}\r\n\r\n\/\/ Subclass (inherit from Shape)\r\n\r\nclass Circle extends Shape {\r\n\r\npublic void area() {\r\n\r\n\/\/ The body of area() is provided here\r\n\r\nSystem.out.println(\"Area of circle: pi*radius*radius\");\r\n\r\n}\r\n\r\n}\r\n\r\n\/\/ Subclass (inherit from Shape)\r\n\r\nclass Triangle extends Shape {\r\n\r\npublic void area() {\r\n\r\n\/\/ The body of area() is provided here\r\n\r\nSystem.out.println(\"Area of triangle: half*base*height\");\r\n\r\n}\r\n\r\n}\r\n\r\nclass Main {\r\n\r\npublic static void main(String[] args) {\r\n\r\nCircle crc = new Circle(); \/\/ Create a Circle object\r\n\r\ncrc.property();\r\n\r\ncrc.area();\r\n\r\nTriangle tri = new Triangle(); \/\/ Create a Triangle object\r\n\r\ntri.property();\r\n\r\ntri.area();\r\n\r\n}\r\n\r\n}\r\n<\/code><\/pre>\r\n<\/div>\r\nThe class shape has been defined as an abstract class, and area as an abstract method, which have been defined under the derived classes, Circle and Triangle.\r\n\r\nOutput for the above program\r\n
\r\n
\r\nA geometrical Shape\r\n\r\nArea of circle: pi*radius*radius\r\n\r\nA geometrical Shape\r\n\r\nArea of triangle: half*base*height\r\n<\/code><\/pre>\r\n<\/div>\r\n

This was the end of object-oriented programming and its concepts in java with example programs. To get in-depth knowledge of core Java <\/em>and advanced java, J2EE,\u00a0 SOA training <\/em>along with its various applications and real-time projects using Servlets, Spring <\/em>with Aspect Oriented Programming (<\/em>AOP) <\/em>architecture,<\/em> Hibernate<\/em> Framework,and Struts <\/em>through JDBC <\/em>you can enroll in Certified Java Course in Chennai<\/a> or Certified Java Course in Bangalore<\/a> by FITA <\/a>or a virtual class for this course,at an affordable price, bundled with real-time projects, certification, support, and career guidance assistance and an active placement cell, to make you an industry required certified java developer.<\/p>\r\n

FITA\u2019s courses training is delivered by professional experts who have worked in the software development and testing industry for a minimum of 10+ years, and have experience of working with different software frameworks and software testing designs.<\/p>","protected":false},"excerpt":{"rendered":"In this, we understand the Object-Oriented Programming (OOP) paradigm of Java, deeply with this table of content\u2026 What is Object-Oriented Programming and Other Programming Paradigm Classes in Java Objects in Java Methods in Java Static and Non Static methods in Java Getter and Setter Methods in Java Major Concepts or Principles Of Object Oriented Programming […]","protected":false},"author":1,"featured_media":89089,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-68629","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java"],"acf":[],"yoast_head":"\nOOPs In JAVA: Object Oriented Programming Concepts With Examples In Java<\/title>\n<meta name=\"description\" content=\"Object-oriented programming System(OOPs) is a programming concept based on the objects that interact with each other to perform the functions. Each object can be characterized with behavior and states. An object keeps the current state and the behavior in the fields and methods. It emphasizes the DRY(Don\u2019t Repeat Yourself) Principle.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.fita.in\/oops-in-java\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"OOPs In JAVA: Object Oriented Programming Concepts With Examples In Java\" \/>\n<meta property=\"og:description\" content=\"Object-oriented programming System(OOPs) is a programming concept based on the objects that interact with each other to perform the functions. Each object can be characterized with behavior and states. An object keeps the current state and the behavior in the fields and methods. It emphasizes the DRY(Don\u2019t Repeat Yourself) Principle.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.fita.in\/oops-in-java\/\" \/>\n<meta property=\"og:site_name\" content=\"FITA Academy\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/fitaAcademy\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-28T10:22:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-09T12:44:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.fita.in\/wp-content\/uploads\/2020\/10\/oops-concepts-in-java.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fitaacademy\" \/>\n<meta name=\"twitter:site\" content=\"@fitaacademy\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"OOPs In JAVA: Object Oriented Programming Concepts With Examples In Java","description":"Object-oriented programming System(OOPs) is a programming concept based on the objects that interact with each other to perform the functions. Each object can be characterized with behavior and states. An object keeps the current state and the behavior in the fields and methods. It emphasizes the DRY(Don\u2019t Repeat Yourself) Principle.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.fita.in\/oops-in-java\/","og_locale":"en_US","og_type":"article","og_title":"OOPs In JAVA: Object Oriented Programming Concepts With Examples In Java","og_description":"Object-oriented programming System(OOPs) is a programming concept based on the objects that interact with each other to perform the functions. Each object can be characterized with behavior and states. An object keeps the current state and the behavior in the fields and methods. It emphasizes the DRY(Don\u2019t Repeat Yourself) Principle.","og_url":"https:\/\/www.fita.in\/oops-in-java\/","og_site_name":"FITA Academy","article_publisher":"https:\/\/www.facebook.com\/fitaAcademy","article_published_time":"2020-10-28T10:22:32+00:00","article_modified_time":"2023-10-09T12:44:58+00:00","og_image":[{"width":800,"height":400,"url":"https:\/\/www.fita.in\/wp-content\/uploads\/2020\/10\/oops-concepts-in-java.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_creator":"@fitaacademy","twitter_site":"@fitaacademy","twitter_misc":{"Written by":"admin","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.fita.in\/oops-in-java\/#article","isPartOf":{"@id":"https:\/\/www.fita.in\/oops-in-java\/"},"author":{"name":"admin","@id":"https:\/\/www.fita.in\/#\/schema\/person\/bb54ebe12aae8299727b8582c44347fb"},"headline":"OOPs In JAVA: Object Oriented Programming Concepts With Examples In Java","datePublished":"2020-10-28T10:22:32+00:00","dateModified":"2023-10-09T12:44:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.fita.in\/oops-in-java\/"},"wordCount":1299,"publisher":{"@id":"https:\/\/www.fita.in\/#organization"},"image":{"@id":"https:\/\/www.fita.in\/oops-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/www.fita.in\/wp-content\/uploads\/2020\/10\/oops-concepts-in-java.jpg","articleSection":["Java"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.fita.in\/oops-in-java\/","url":"https:\/\/www.fita.in\/oops-in-java\/","name":"OOPs In JAVA: Object Oriented Programming Concepts With Examples In Java","isPartOf":{"@id":"https:\/\/www.fita.in\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.fita.in\/oops-in-java\/#primaryimage"},"image":{"@id":"https:\/\/www.fita.in\/oops-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/www.fita.in\/wp-content\/uploads\/2020\/10\/oops-concepts-in-java.jpg","datePublished":"2020-10-28T10:22:32+00:00","dateModified":"2023-10-09T12:44:58+00:00","description":"Object-oriented programming System(OOPs) is a programming concept based on the objects that interact with each other to perform the functions. Each object can be characterized with behavior and states. An object keeps the current state and the behavior in the fields and methods. It emphasizes the DRY(Don\u2019t Repeat Yourself) Principle.","breadcrumb":{"@id":"https:\/\/www.fita.in\/oops-in-java\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.fita.in\/oops-in-java\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.fita.in\/oops-in-java\/#primaryimage","url":"https:\/\/www.fita.in\/wp-content\/uploads\/2020\/10\/oops-concepts-in-java.jpg","contentUrl":"https:\/\/www.fita.in\/wp-content\/uploads\/2020\/10\/oops-concepts-in-java.jpg","width":800,"height":400},{"@type":"BreadcrumbList","@id":"https:\/\/www.fita.in\/oops-in-java\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.fita.in\/"},{"@type":"ListItem","position":2,"name":"OOPs In JAVA: Object Oriented Programming Concepts With Examples In Java"}]},{"@type":"WebSite","@id":"https:\/\/www.fita.in\/#website","url":"https:\/\/www.fita.in\/","name":"FITA Academy","description":"","publisher":{"@id":"https:\/\/www.fita.in\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.fita.in\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.fita.in\/#organization","name":"FITA Academy","url":"https:\/\/www.fita.in\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.fita.in\/#\/schema\/logo\/image\/","url":"https:\/\/www.fita.in\/wp-content\/uploads\/2019\/07\/site-logo-2.png","contentUrl":"https:\/\/www.fita.in\/wp-content\/uploads\/2019\/07\/site-logo-2.png","width":206,"height":100,"caption":"FITA Academy"},"image":{"@id":"https:\/\/www.fita.in\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/fitaAcademy","https:\/\/x.com\/fitaacademy","https:\/\/www.instagram.com\/fita_Academy\/","https:\/\/www.linkedin.com\/company\/9223636\/admin\/","https:\/\/www.youtube.com\/channel\/UCIbVc86kI5Jnq4Ez_8_hhIg?view_as=subscriber"]},{"@type":"Person","@id":"https:\/\/www.fita.in\/#\/schema\/person\/bb54ebe12aae8299727b8582c44347fb","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1eb033f2b18b94065fabbcf6c8d8766b4ce3e554fea0cd7e183a04d46a52a42c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1eb033f2b18b94065fabbcf6c8d8766b4ce3e554fea0cd7e183a04d46a52a42c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1eb033f2b18b94065fabbcf6c8d8766b4ce3e554fea0cd7e183a04d46a52a42c?s=96&d=mm&r=g","caption":"admin"}}]}},"_links":{"self":[{"href":"https:\/\/www.fita.in\/wp-json\/wp\/v2\/posts\/68629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fita.in\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fita.in\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fita.in\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fita.in\/wp-json\/wp\/v2\/comments?post=68629"}],"version-history":[{"count":9,"href":"https:\/\/www.fita.in\/wp-json\/wp\/v2\/posts\/68629\/revisions"}],"predecessor-version":[{"id":94639,"href":"https:\/\/www.fita.in\/wp-json\/wp\/v2\/posts\/68629\/revisions\/94639"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fita.in\/wp-json\/wp\/v2\/media\/89089"}],"wp:attachment":[{"href":"https:\/\/www.fita.in\/wp-json\/wp\/v2\/media?parent=68629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fita.in\/wp-json\/wp\/v2\/categories?post=68629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fita.in\/wp-json\/wp\/v2\/tags?post=68629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}