{"id":36547,"date":"2024-04-26T23:00:40","date_gmt":"2024-04-26T23:00:40","guid":{"rendered":"http:\/\/localhost\/branding\/part-1\/"},"modified":"2024-04-26T23:00:40","modified_gmt":"2024-04-26T23:00:40","slug":"part-1","status":"publish","type":"post","link":"https:\/\/sheilathewriter.com\/blog\/part-1\/","title":{"rendered":"Part 1"},"content":{"rendered":"<p>Part 1:<\/p>\n<p>Inheritance is the object oriented concept which enables to implement real world inheritance behavior. It enables the user to inherit the properties and behavior and facilitate the reusability of the code and overriding the methods. It is implemented by using \u201cextends and implements\u201d keyword where child class extends the behavior of the parent class. The inheritance helps in establishing the relationship between two classes also referred as super class and sub class. Moreover, a super class may have several sub classes.  This property of OOPS makes code more flexible whereby changes can be implemented only in parent class and its property will automatically be inherited in child class. <\/p>\n<p>For example \u2013 The following example shows that employee is a super class and programmer is a sub class, where class programmer can access the behavior of the emp class.<\/p>\n<p>class emp{<\/p>\n<p>int sal = 40000;<\/p>\n<p>}<\/p>\n<p>class programmer extends emp{<\/p>\n<p>int incentive = 10000;<\/p>\n<p>Public static void main(String args[])<\/p>\n<p>{<\/p>\n<p>Programmer a = new Programmer();<\/p>\n<p>system.out.println(\u201cSalary of Programmer is :\u201d + a.sal);<\/p>\n<p>system.out.println(\u201cAdditional incentive is :\u201d + a.incentive);<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>Part 2:<\/p>\n<p>Abstraction is the ability to make class abstract which cannot be instantiated. Abstract class is something which is not concrete and is incomplete. We can take the example of the remote control, where we can control the device with the given button and we do not take care of the circuits in the remote, these are irrelevant. In Java, this concept can be applied as follows:<\/p>\n<p>abstract class SoupFactory <\/p>\n<p>{<\/p>\n<p>String factLoc;<\/p>\n<p>public String getFactLocation() <\/p>\n<p>{<\/p>\n<p>return factLoc;<\/p>\n<p>}<\/p>\n<p>public ChickenS makeChickenS() <\/p>\n<p>{<\/p>\n<p>return new ChickenS();<\/p>\n<p>}<\/p>\n<p>public CChowder makeCChowder() <\/p>\n<p>{<\/p>\n<p>return new CChowder();<\/p>\n<p>}<\/p>\n<p>public FishChowder makeFishChowder() <\/p>\n<p>{<\/p>\n<p>return new FishChowder();<\/p>\n<p>}<\/p>\n<p>public Mstrone makeMstrone() <\/p>\n<p>{<\/p>\n<p>return new Mstrone();<\/p>\n<p>}<\/p>\n<p>public PastaFazul makePastaFazul() <\/p>\n<p>{<\/p>\n<p>return new PastaFazul();<\/p>\n<p>}<\/p>\n<p>public TofuS makeTofuS() <\/p>\n<p>{<\/p>\n<p>return new TofuS();<\/p>\n<p>}<\/p>\n<p>public VegSoup makeVegSoup() <\/p>\n<p>{<\/p>\n<p>return new VegSoup();<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>An object can be defined as \u201cSoupFactory\u201d, and instantiated by any soup factory either HonoluluConcreteSoupFactory or BostonConcreteSoupFactory. Both soup factories have the \u201cmakeFishChowder\u201d method, and both return a \u201cFishChowder\u201d type class. However, the HCSF returns a \u201cFishChowder\u201d subclass of \u201cHonoluluFishChowder\u201d, while the BCSF returns a \u201cFishChowder\u201d subclass of \u201cBostonFishChowder\u201d. Thus, the abstract class \u201csoupFactory\u201d is used by any of the soup factories <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Part 1: Inheritance is the object oriented concept which enables to implement real world inheritance behavior. It enables the user<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-36547","post","type-post","status-publish","format-standard","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Part 1 - sheilathewriter<\/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:\/\/sheilathewriter.com\/blog\/part-1\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Part 1 - sheilathewriter\" \/>\n<meta property=\"og:description\" content=\"Part 1: Inheritance is the object oriented concept which enables to implement real world inheritance behavior. It enables the user\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sheilathewriter.com\/blog\/part-1\/\" \/>\n<meta property=\"og:site_name\" content=\"sheilathewriter\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-26T23:00:40+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/sheilathewriter.com\/blog\/part-1\/\",\"url\":\"https:\/\/sheilathewriter.com\/blog\/part-1\/\",\"name\":\"Part 1 - sheilathewriter\",\"isPartOf\":{\"@id\":\"https:\/\/sheilathewriter.com\/blog\/#website\"},\"datePublished\":\"2024-04-26T23:00:40+00:00\",\"author\":{\"@id\":\"https:\/\/sheilathewriter.com\/blog\/#\/schema\/person\/f5844d28db4a1882523a0a69560bf0ab\"},\"breadcrumb\":{\"@id\":\"https:\/\/sheilathewriter.com\/blog\/part-1\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/sheilathewriter.com\/blog\/part-1\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/sheilathewriter.com\/blog\/part-1\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/sheilathewriter.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Part 1\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/sheilathewriter.com\/blog\/#website\",\"url\":\"https:\/\/sheilathewriter.com\/blog\/\",\"name\":\"sheilathewriter\",\"description\":\"Custom essay writing\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/sheilathewriter.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/sheilathewriter.com\/blog\/#\/schema\/person\/f5844d28db4a1882523a0a69560bf0ab\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sheilathewriter.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9cf817440d627e98709fcac9c5cc379958985e679d683af80df1879b5a471013?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9cf817440d627e98709fcac9c5cc379958985e679d683af80df1879b5a471013?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/opskill.com\/propapers\"],\"url\":\"https:\/\/sheilathewriter.com\/blog\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Part 1 - sheilathewriter","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:\/\/sheilathewriter.com\/blog\/part-1\/","og_locale":"en_US","og_type":"article","og_title":"Part 1 - sheilathewriter","og_description":"Part 1: Inheritance is the object oriented concept which enables to implement real world inheritance behavior. It enables the user","og_url":"https:\/\/sheilathewriter.com\/blog\/part-1\/","og_site_name":"sheilathewriter","article_published_time":"2024-04-26T23:00:40+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/sheilathewriter.com\/blog\/part-1\/","url":"https:\/\/sheilathewriter.com\/blog\/part-1\/","name":"Part 1 - sheilathewriter","isPartOf":{"@id":"https:\/\/sheilathewriter.com\/blog\/#website"},"datePublished":"2024-04-26T23:00:40+00:00","author":{"@id":"https:\/\/sheilathewriter.com\/blog\/#\/schema\/person\/f5844d28db4a1882523a0a69560bf0ab"},"breadcrumb":{"@id":"https:\/\/sheilathewriter.com\/blog\/part-1\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sheilathewriter.com\/blog\/part-1\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/sheilathewriter.com\/blog\/part-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sheilathewriter.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Part 1"}]},{"@type":"WebSite","@id":"https:\/\/sheilathewriter.com\/blog\/#website","url":"https:\/\/sheilathewriter.com\/blog\/","name":"sheilathewriter","description":"Custom essay writing","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sheilathewriter.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/sheilathewriter.com\/blog\/#\/schema\/person\/f5844d28db4a1882523a0a69560bf0ab","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sheilathewriter.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9cf817440d627e98709fcac9c5cc379958985e679d683af80df1879b5a471013?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9cf817440d627e98709fcac9c5cc379958985e679d683af80df1879b5a471013?s=96&d=mm&r=g","caption":"admin"},"sameAs":["http:\/\/opskill.com\/propapers"],"url":"https:\/\/sheilathewriter.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/posts\/36547","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/comments?post=36547"}],"version-history":[{"count":0,"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/posts\/36547\/revisions"}],"wp:attachment":[{"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/media?parent=36547"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/categories?post=36547"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/tags?post=36547"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}