{"id":3388,"date":"2024-11-15T16:12:41","date_gmt":"2024-11-15T16:12:41","guid":{"rendered":"https:\/\/sankhamtech.com\/index.php\/content\/india\/english\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-access-modifiers-in-java-inheritance\/"},"modified":"2024-11-15T16:13:50","modified_gmt":"2024-11-15T16:13:50","slug":"understanding-access-modifiers-in-java-inheritance","status":"publish","type":"page","link":"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-access-modifiers-in-java-inheritance\/","title":{"rendered":"Understanding Access Modifiers in Java Inheritance"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"3388\" class=\"elementor elementor-3388\">\n\t\t\t\t<div class=\"elementor-element elementor-element-e2643cf e-flex e-con-boxed e-con e-parent\" data-id=\"e2643cf\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-244ec51 e-con-full e-flex e-con e-child\" data-id=\"244ec51\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-96b3c2a elementor-hidden-mobile elementor-widget elementor-widget-text-editor\" data-id=\"96b3c2a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h6 style=\"text-align: center;\"><span style=\"text-decoration: underline;\">Lessons<\/span><\/h6>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-436f35e elementor-hidden-desktop elementor-hidden-tablet elementor-widget elementor-widget-text-editor\" data-id=\"436f35e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h6 style=\"text-align: center;\"><a href=\"https:\/\/sankhamtech.com\/index.php\/content\/india\/english\/home\/free-courses\/understanding-object-oriented-programming-in-java\/\"><span style=\"text-decoration: underline;\">Lessons<\/span><\/a><\/h6>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6c5b677 elementor-hidden-mobile elementor-widget elementor-widget-darsanam_header_menu_widget\" data-id=\"6c5b677\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"darsanam_header_menu_widget.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"darsanam-menu-wrapper \"><div class='hamburger-icon'><i class=\"fas fa-grip-lines\"><\/i> &nbsp; <\/div><div class=\"menu-container\"><nav class='elementor-menu'><ul class='darsanam-menu-vertical'><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/setting-up-your-development-environment\/'>Setting Up Your Development Environment<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/java-basics-syntax-variables-data-types-and-operators\/'>Java Basics - Syntax, Variables, Data Types, and Operators<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-objects-and-classes-in-java\/'>Understanding Objects and Classes in Java<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-encapsulation-in-java\/'>Understanding Encapsulation in Java<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-inheritance-in-java-the-is-a-relationship\/'>Understanding Inheritance in Java: The \"Is-A\" Relationship<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-constructors-in-java-inheritance\/'>Understanding Constructors in Java Inheritance<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-access-modifiers-in-java-inheritance\/' style='color: #FF7700 !important'>Understanding Access Modifiers in Java Inheritance<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-polymorphism-in-java\/'>Understanding Polymorphism in Java<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-abstract-classes-and-methods-in-java\/'>Understanding Abstract Classes and Methods in Java<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-interfaces-in-java\/'>Understanding Interfaces in Java<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-exception-handling-in-java\/'>Understanding Exception Handling in Java<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/java-collections-framework-list-set-map-and-their-implementations\/'>Java Collections Framework - List, Set, Map, and their implementations<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-loops-in-java-foreach-and-lambda\/'>Understanding Loops in Java: forEach and lambda<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-the-serializable-interface-in-java\/'>Understanding the Serializable Interface in Java<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-java-beans\/'>Understanding Java Beans<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/making-api-calls-in-java-a-comprehensive-guide\/'>Making API Calls in Java: A Comprehensive Guide<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><\/ul><\/nav><\/div><\/div>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-110b7c7 e-con-full e-flex e-con e-child\" data-id=\"110b7c7\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-de40e14 elementor-widget elementor-widget-text-editor\" data-id=\"de40e14\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h2>Understanding Access Modifiers in Java Inheritance<\/h2><p><\/p><p><\/p><h4 id=\"block-c4208d9f-d9d0-4258-9036-9e879827e401\" class=\"block-editor-rich-text__editable block-editor-block-list__block wp-block wp-block-heading rich-text\" role=\"document\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Block: Heading\" data-block=\"c4208d9f-d9d0-4258-9036-9e879827e401\" data-type=\"core\/heading\" data-title=\"Heading\" data-wp-block-attribute-key=\"content\">Introduction<\/h4><p id=\"block-51c0f9bb-ad7d-44ba-b00d-ed7cce47d89d\" class=\"block-editor-rich-text__editable block-editor-block-list__block wp-block wp-block-paragraph rich-text\" role=\"document\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Block: Paragraph\" data-block=\"51c0f9bb-ad7d-44ba-b00d-ed7cce47d89d\" data-type=\"core\/paragraph\" data-title=\"Paragraph\" data-empty=\"false\" data-wp-block-attribute-key=\"content\">Access modifiers in Java define the level of access to classes, methods, and variables. They are crucial in controlling how different parts of your code, or even external code, can interact with the class and its members. In the context of inheritance, these modifiers dictate how the members (methods and variables) of a superclass are accessible to a subclass.<\/p><h4 id=\"block-cf772517-4240-4e20-b2b3-b9b9f0d9b0b8\" class=\"block-editor-rich-text__editable block-editor-block-list__block wp-block wp-block-heading rich-text\" role=\"document\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Block: Heading\" data-block=\"cf772517-4240-4e20-b2b3-b9b9f0d9b0b8\" data-type=\"core\/heading\" data-title=\"Heading\" data-wp-block-attribute-key=\"content\">Access Modifiers and Their Behavior in Inheritance<\/h4><p id=\"block-269b2797-2d9c-45e3-88d4-f0af0c7c1c65\" class=\"block-editor-rich-text__editable block-editor-block-list__block wp-block wp-block-paragraph rich-text\" role=\"document\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Block: Paragraph\" data-block=\"269b2797-2d9c-45e3-88d4-f0af0c7c1c65\" data-type=\"core\/paragraph\" data-title=\"Paragraph\" data-empty=\"false\" data-wp-block-attribute-key=\"content\">The table below summarizes how different access modifiers affect the visibility of superclass members in subclasses, both within the same package and across different packages.<\/p><figure id=\"block-a3721056-733b-4032-96a8-c73bd13ca1ec\" class=\"block-editor-block-list__block wp-block wp-block-table\" tabindex=\"0\" role=\"document\" aria-label=\"Block: Table\" data-block=\"a3721056-733b-4032-96a8-c73bd13ca1ec\" data-type=\"core\/table\" data-title=\"Table\"><table><thead><tr><th class=\"wp-block-table__cell-content\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Header cell text\">Access Modifier<\/div><\/th><th class=\"wp-block-table__cell-content\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Header cell text\">Subclass in Same Package<\/div><\/th><th class=\"wp-block-table__cell-content\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Header cell text\">Subclass in Different Package<\/div><\/th><\/tr><\/thead><tbody><tr><td class=\"wp-block-table__cell-content\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Body cell text\"><strong>Public<\/strong><\/div><\/td><td class=\"wp-block-table__cell-content\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Body cell text\">Full Access<\/div><\/td><td class=\"wp-block-table__cell-content\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Body cell text\">Full Access<\/div><\/td><\/tr><tr><td class=\"wp-block-table__cell-content\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Body cell text\"><strong>Protected<\/strong><\/div><\/td><td class=\"wp-block-table__cell-content\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Body cell text\">Full Access<\/div><\/td><td class=\"wp-block-table__cell-content\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Body cell text\">Access through Inheritance<\/div><\/td><\/tr><tr><td class=\"wp-block-table__cell-content\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Body cell text\"><strong>Default<\/strong><\/div><\/td><td class=\"wp-block-table__cell-content\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Body cell text\">Full Access<\/div><\/td><td class=\"wp-block-table__cell-content\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Body cell text\">No Access<\/div><\/td><\/tr><tr><td class=\"wp-block-table__cell-content\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Body cell text\"><strong>Private<\/strong><\/div><\/td><td class=\"wp-block-table__cell-content\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Body cell text\">No Access<\/div><\/td><td class=\"wp-block-table__cell-content\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Body cell text\">No Access<\/div><\/td><\/tr><\/tbody><\/table><\/figure><h4 id=\"block-f48d40de-727d-4626-b814-e71e8e94958a\" class=\"block-editor-rich-text__editable block-editor-block-list__block wp-block wp-block-heading rich-text\" role=\"document\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Block: Heading\" data-block=\"f48d40de-727d-4626-b814-e71e8e94958a\" data-type=\"core\/heading\" data-title=\"Heading\" data-wp-block-attribute-key=\"content\">Explanation:<\/h4><ol id=\"block-28980e78-7756-4928-9262-8e77380a2903\" class=\"block-editor-block-list__block wp-block wp-block-list block-editor-block-list__layout\" tabindex=\"0\" role=\"document\" aria-label=\"Block: List\" data-block=\"28980e78-7756-4928-9262-8e77380a2903\" data-type=\"core\/list\" data-title=\"List\" data-is-drop-zone=\"true\"><li id=\"block-7501168f-bbf1-4927-bf9f-b9a808a77934\" class=\"block-editor-block-list__block wp-block wp-block-list-item block-editor-block-list__layout\" tabindex=\"0\" role=\"document\" aria-label=\"Block: List item\" data-block=\"7501168f-bbf1-4927-bf9f-b9a808a77934\" data-type=\"core\/list-item\" data-title=\"List item\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"List text\" data-wp-block-attribute-key=\"content\"><strong>Public<\/strong>: Members are accessible everywhere, irrespective of package boundaries. A subclass, regardless of its package, has full access to public members of its superclass.<\/div><\/li><li id=\"block-9502dca8-4d46-47aa-a1a0-a5d6ac16e5ec\" class=\"block-editor-block-list__block wp-block wp-block-list-item block-editor-block-list__layout\" tabindex=\"0\" role=\"document\" aria-label=\"Block: List item\" data-block=\"9502dca8-4d46-47aa-a1a0-a5d6ac16e5ec\" data-type=\"core\/list-item\" data-title=\"List item\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"List text\" data-wp-block-attribute-key=\"content\"><strong>Protected<\/strong>: Members are accessible within the same package. For subclasses in different packages, protected members are accessible only through inheritance (i.e., within the subclass itself or through methods of the subclass).<\/div><\/li><li id=\"block-65349d7c-f878-462e-8ecf-97c894efbffa\" class=\"block-editor-block-list__block wp-block wp-block-list-item block-editor-block-list__layout\" tabindex=\"0\" role=\"document\" aria-label=\"Block: List item\" data-block=\"65349d7c-f878-462e-8ecf-97c894efbffa\" data-type=\"core\/list-item\" data-title=\"List item\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"List text\" data-wp-block-attribute-key=\"content\"><strong>Default (Package-Private)<\/strong>: Members are accessible only within the same package. A subclass in a different package cannot access default members of its superclass.<\/div><\/li><li id=\"block-be4e74f9-9dd8-42d3-9850-1417146dad8b\" class=\"block-editor-block-list__block wp-block wp-block-list-item block-editor-block-list__layout\" tabindex=\"0\" role=\"document\" aria-label=\"Block: List item\" data-block=\"be4e74f9-9dd8-42d3-9850-1417146dad8b\" data-type=\"core\/list-item\" data-title=\"List item\"><div class=\"block-editor-rich-text__editable rich-text\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"List text\" data-wp-block-attribute-key=\"content\"><strong>Private<\/strong>: Members are not accessible outside the class they are declared in. This means that private members of a superclass are never accessible directly by a subclass, whether it&#8217;s in the same package or a different one.<\/div><\/li><\/ol><h4 id=\"block-e7d6ef42-0759-49ed-939b-a25616634ccc\" class=\"block-editor-rich-text__editable block-editor-block-list__block wp-block wp-block-heading rich-text\" role=\"document\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Block: Heading\" data-block=\"e7d6ef42-0759-49ed-939b-a25616634ccc\" data-type=\"core\/heading\" data-title=\"Heading\" data-wp-block-attribute-key=\"content\">Conclusion<\/h4><p id=\"block-0db4214c-ae09-4619-ab66-a9108798a671\" class=\"block-editor-rich-text__editable block-editor-block-list__block wp-block wp-block-paragraph rich-text\" role=\"document\" contenteditable=\"true\" aria-multiline=\"true\" aria-label=\"Block: Paragraph\" data-block=\"0db4214c-ae09-4619-ab66-a9108798a671\" data-type=\"core\/paragraph\" data-title=\"Paragraph\" data-empty=\"false\" data-wp-block-attribute-key=\"content\">Access modifiers play a vital role in Java inheritance. They are instrumental in encapsulating the code and defining a clear structure and hierarchy. Understanding how these modifiers work in different scenarios of inheritance is essential for designing robust and secure Java applications.<\/p><p><\/p><p><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Lessons Lessons &nbsp; Setting Up Your Development Environment Java Basics &#8211; Syntax, Variables, Data Types, and Operators Understanding Objects and Classes in Java Understanding Encapsulation in Java Understanding Inheritance in Java: The &#8220;Is-A&#8221; Relationship Understanding Constructors in Java Inheritance Understanding Access Modifiers in Java Inheritance Understanding Access Modifiers in Java Inheritance Introduction Access modifiers in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3335,"menu_order":6,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3388","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Understanding Access Modifiers in Java Inheritance - Sankham Technologies<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-access-modifiers-in-java-inheritance\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Understanding Access Modifiers in Java Inheritance - Sankham Technologies\" \/>\n<meta property=\"og:description\" content=\"Lessons Lessons &nbsp; Setting Up Your Development Environment Java Basics &#8211; Syntax, Variables, Data Types, and Operators Understanding Objects and Classes in Java Understanding Encapsulation in Java Understanding Inheritance in Java: The &#8220;Is-A&#8221; Relationship Understanding Constructors in Java Inheritance Understanding Access Modifiers in Java Inheritance Understanding Access Modifiers in Java Inheritance Introduction Access modifiers in [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-access-modifiers-in-java-inheritance\/\" \/>\n<meta property=\"og:site_name\" content=\"Sankham Technologies\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-15T16:13:50+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sankhamtech.com\\\/index.php\\\/content\\\/in\\\/en\\\/home\\\/free-courses\\\/understanding-object-oriented-programming-in-java\\\/understanding-access-modifiers-in-java-inheritance\\\/\",\"url\":\"https:\\\/\\\/sankhamtech.com\\\/index.php\\\/content\\\/in\\\/en\\\/home\\\/free-courses\\\/understanding-object-oriented-programming-in-java\\\/understanding-access-modifiers-in-java-inheritance\\\/\",\"name\":\"Understanding Access Modifiers in Java Inheritance - Sankham Technologies\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sankhamtech.com\\\/#website\"},\"datePublished\":\"2024-11-15T16:12:41+00:00\",\"dateModified\":\"2024-11-15T16:13:50+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sankhamtech.com\\\/index.php\\\/content\\\/in\\\/en\\\/home\\\/free-courses\\\/understanding-object-oriented-programming-in-java\\\/understanding-access-modifiers-in-java-inheritance\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sankhamtech.com\\\/index.php\\\/content\\\/in\\\/en\\\/home\\\/free-courses\\\/understanding-object-oriented-programming-in-java\\\/understanding-access-modifiers-in-java-inheritance\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sankhamtech.com\\\/index.php\\\/content\\\/in\\\/en\\\/home\\\/free-courses\\\/understanding-object-oriented-programming-in-java\\\/understanding-access-modifiers-in-java-inheritance\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sankhamtech.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Content\",\"item\":\"https:\\\/\\\/sankhamtech.com\\\/index.php\\\/content\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"India\",\"item\":\"https:\\\/\\\/sankhamtech.com\\\/index.php\\\/content\\\/in\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"English\",\"item\":\"https:\\\/\\\/sankhamtech.com\\\/index.php\\\/content\\\/in\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sankhamtech.com\\\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"Free Courses\",\"item\":\"https:\\\/\\\/sankhamtech.com\\\/index.php\\\/content\\\/in\\\/en\\\/home\\\/free-courses\\\/\"},{\"@type\":\"ListItem\",\"position\":7,\"name\":\"Understanding Object-Oriented Programming in Java\",\"item\":\"https:\\\/\\\/sankhamtech.com\\\/indexphp\\\/content\\\/in\\\/en\\\/home\\\/free-courses\\\/understanding-object-oriented-programming-in-java\\\/\"},{\"@type\":\"ListItem\",\"position\":8,\"name\":\"Understanding Access Modifiers in Java Inheritance\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/sankhamtech.com\\\/#website\",\"url\":\"https:\\\/\\\/sankhamtech.com\\\/\",\"name\":\"Sankham Technologies\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/sankhamtech.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/sankhamtech.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/sankhamtech.com\\\/#organization\",\"name\":\"Sankham Technologies\",\"url\":\"https:\\\/\\\/sankhamtech.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/sankhamtech.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/sankhamtech.com\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/Logo-Dark-1.png\",\"contentUrl\":\"https:\\\/\\\/sankhamtech.com\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/Logo-Dark-1.png\",\"width\":306,\"height\":74,\"caption\":\"Sankham Technologies\"},\"image\":{\"@id\":\"https:\\\/\\\/sankhamtech.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Understanding Access Modifiers in Java Inheritance - Sankham Technologies","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:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-access-modifiers-in-java-inheritance\/","og_locale":"en_US","og_type":"article","og_title":"Understanding Access Modifiers in Java Inheritance - Sankham Technologies","og_description":"Lessons Lessons &nbsp; Setting Up Your Development Environment Java Basics &#8211; Syntax, Variables, Data Types, and Operators Understanding Objects and Classes in Java Understanding Encapsulation in Java Understanding Inheritance in Java: The &#8220;Is-A&#8221; Relationship Understanding Constructors in Java Inheritance Understanding Access Modifiers in Java Inheritance Understanding Access Modifiers in Java Inheritance Introduction Access modifiers in [&hellip;]","og_url":"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-access-modifiers-in-java-inheritance\/","og_site_name":"Sankham Technologies","article_modified_time":"2024-11-15T16:13:50+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-access-modifiers-in-java-inheritance\/","url":"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-access-modifiers-in-java-inheritance\/","name":"Understanding Access Modifiers in Java Inheritance - Sankham Technologies","isPartOf":{"@id":"https:\/\/sankhamtech.com\/#website"},"datePublished":"2024-11-15T16:12:41+00:00","dateModified":"2024-11-15T16:13:50+00:00","breadcrumb":{"@id":"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-access-modifiers-in-java-inheritance\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-access-modifiers-in-java-inheritance\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/understanding-access-modifiers-in-java-inheritance\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sankhamtech.com\/"},{"@type":"ListItem","position":2,"name":"Content","item":"https:\/\/sankhamtech.com\/index.php\/content\/"},{"@type":"ListItem","position":3,"name":"India","item":"https:\/\/sankhamtech.com\/index.php\/content\/in\/"},{"@type":"ListItem","position":4,"name":"English","item":"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/"},{"@type":"ListItem","position":5,"name":"Home","item":"https:\/\/sankhamtech.com\/"},{"@type":"ListItem","position":6,"name":"Free Courses","item":"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/"},{"@type":"ListItem","position":7,"name":"Understanding Object-Oriented Programming in Java","item":"https:\/\/sankhamtech.com\/indexphp\/content\/in\/en\/home\/free-courses\/understanding-object-oriented-programming-in-java\/"},{"@type":"ListItem","position":8,"name":"Understanding Access Modifiers in Java Inheritance"}]},{"@type":"WebSite","@id":"https:\/\/sankhamtech.com\/#website","url":"https:\/\/sankhamtech.com\/","name":"Sankham Technologies","description":"","publisher":{"@id":"https:\/\/sankhamtech.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sankhamtech.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/sankhamtech.com\/#organization","name":"Sankham Technologies","url":"https:\/\/sankhamtech.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sankhamtech.com\/#\/schema\/logo\/image\/","url":"https:\/\/sankhamtech.com\/wp-content\/uploads\/2023\/12\/Logo-Dark-1.png","contentUrl":"https:\/\/sankhamtech.com\/wp-content\/uploads\/2023\/12\/Logo-Dark-1.png","width":306,"height":74,"caption":"Sankham Technologies"},"image":{"@id":"https:\/\/sankhamtech.com\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/sankhamtech.com\/index.php\/wp-json\/wp\/v2\/pages\/3388","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sankhamtech.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sankhamtech.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sankhamtech.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sankhamtech.com\/index.php\/wp-json\/wp\/v2\/comments?post=3388"}],"version-history":[{"count":4,"href":"https:\/\/sankhamtech.com\/index.php\/wp-json\/wp\/v2\/pages\/3388\/revisions"}],"predecessor-version":[{"id":3392,"href":"https:\/\/sankhamtech.com\/index.php\/wp-json\/wp\/v2\/pages\/3388\/revisions\/3392"}],"up":[{"embeddable":true,"href":"https:\/\/sankhamtech.com\/index.php\/wp-json\/wp\/v2\/pages\/3335"}],"wp:attachment":[{"href":"https:\/\/sankhamtech.com\/index.php\/wp-json\/wp\/v2\/media?parent=3388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}