<br />
<b>Warning</b>:  Undefined array key "global_protection_id" in <b>/home/wikitechy/public_html/interview-questions/wp-content/plugins/content-protector/inc/class-ps-rest-handler.php</b> on line <b>51</b><br />
{"id":2567,"date":"2021-08-27T00:15:30","date_gmt":"2021-08-27T00:15:30","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=2567"},"modified":"2021-09-03T09:17:48","modified_gmt":"2021-09-03T09:17:48","slug":"palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values-from-one-class-to-another-which-of-following-concept-should-she-use-to-do-so","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values-from-one-class-to-another-which-of-following-concept-should-she-use-to-do-so\/","title":{"rendered":"Palak enters a coding competition she wants to write code to pass down values from one class to another. Which of following concept should she use to do so ?"},"content":{"rendered":"<div class=\"TextHeading\">\n<div class=\"hddn\">\n<p class=\"color-pink\">Palak enters a coding competition she wants to write code to pass down values from one class to another. Which of following concept should she use to do so ?<\/p>\n<div class=\"row\">\n<div class=\"col-sm-6\">\n<p>A. Inherits<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>B. Extends<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>C. Construct<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>D. All of the mentioned<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3 id=\"answer-c-extends\"><b>Answer :\u00a0<\/b>C. Extends<\/h3>\n<div class=\"subheading\">\n<h2 id=\"explanation\">Explanation:<\/h2>\n<\/div>\n<div class=\"Content\">\n<div class=\"hddn\">\n<ul>\n<li>A class in Java can extend another class to become a subclass. When class B extends the class A, B becomes subclass (child) and A becomes superclass (parent). A subclass can reuse all the features of the parent class and code reuse is a major reason for extending a class<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"text-center row\">\n<div class=\"col-sm-12\"><\/div>\n<\/div>\n<div class=\"ImageContent\">\n<div class=\"hddn\"><img decoding=\"async\" class=\"img-responsive center-block\" src=\"https:\/\/cdn.wikitechy.com\/interview-questions\/programming\/inheritance-in-java.jpg\" alt=\"Inheritance in Java\" \/><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Answer :\u00a0C. Extends<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"passster_activate_protection":false,"passster_protect_child_pages":"","passster_protection_type":"password","passster_password":"","passster_activate_overwrite_defaults":"","passster_headline":"","passster_instruction":"","passster_placeholder":"","passster_button":"","passster_id":"","passster_activate_misc_settings":"","passster_redirect_url":"","passster_hide":"no","passster_area_shortcode":"","gtb_hide_title":false,"gtb_wrap_title":false,"gtb_class_title":"","gtb_remove_headerfooter":false,"footnotes":""},"categories":[15949],"tags":[15971,15988,15972,15973,15989,15974,15983,2564,2271,15985,15987,15982,15975,15976,15977,16276,15978,15981,15979,4100,15984,15986,15980,15970],"class_list":["post-2567","post","type-post","status-publish","format-standard","hentry","category-programming","tag-abstract-class-interview-questions-c","tag-abstract-keyword-in-java","tag-abstraction-in-java","tag-abstraction-interview-questions-and-answers-for-experienced","tag-c-friend-class","tag-extend-function-python","tag-implements-keyword-in-java","tag-inheritance-in-c","tag-inheritance-in-c-with-example-program","tag-inheritance-in-java","tag-interface-in-java","tag-java-extends-example","tag-javascript-extend-function-prototype","tag-javascript-extend-object","tag-jquery-extend-function","tag-most-asked-sapient-nitro-interview-questions","tag-palak-enters-a-coding-competition","tag-palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values","tag-palak-enters-a-coding-competition-she-wants-to-write-codewhat-is-abstraction","tag-polymorphism-in-java","tag-super-keyword-in-java","tag-types-of-inheritance-in-java","tag-what-is-extend-function","tag-write-code-to-pass-down-values-from-one-class-to-another"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Palak enters a coding competition she wants to write code to pass down<\/title>\n<meta name=\"description\" content=\"Palak enters a coding competition she wants to write code to pass down values from one class to another - A class in Java can extend another class to become a subclass.\" \/>\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.wikitechy.com\/interview-questions\/programming\/palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values-from-one-class-to-another-which-of-following-concept-should-she-use-to-do-so\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Palak enters a coding competition she wants to write code to pass down\" \/>\n<meta property=\"og:description\" content=\"Palak enters a coding competition she wants to write code to pass down values from one class to another - A class in Java can extend another class to become a subclass.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/programming\/palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values-from-one-class-to-another-which-of-following-concept-should-she-use-to-do-so\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-27T00:15:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-03T09:17:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.wikitechy.com\/interview-questions\/programming\/inheritance-in-java.jpg\" \/>\n<meta name=\"author\" content=\"Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/programming\/palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values-from-one-class-to-another-which-of-following-concept-should-she-use-to-do-so\/\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/programming\/palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values-from-one-class-to-another-which-of-following-concept-should-she-use-to-do-so\/\",\"name\":\"Palak enters a coding competition she wants to write code to pass down\",\"isPartOf\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/programming\/palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values-from-one-class-to-another-which-of-following-concept-should-she-use-to-do-so\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/programming\/palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values-from-one-class-to-another-which-of-following-concept-should-she-use-to-do-so\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdn.wikitechy.com\/interview-questions\/programming\/inheritance-in-java.jpg\",\"datePublished\":\"2021-08-27T00:15:30+00:00\",\"dateModified\":\"2021-09-03T09:17:48+00:00\",\"author\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757\"},\"description\":\"Palak enters a coding competition she wants to write code to pass down values from one class to another - A class in Java can extend another class to become a subclass.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wikitechy.com\/interview-questions\/programming\/palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values-from-one-class-to-another-which-of-following-concept-should-she-use-to-do-so\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/programming\/palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values-from-one-class-to-another-which-of-following-concept-should-she-use-to-do-so\/#primaryimage\",\"url\":\"https:\/\/cdn.wikitechy.com\/interview-questions\/programming\/inheritance-in-java.jpg\",\"contentUrl\":\"https:\/\/cdn.wikitechy.com\/interview-questions\/programming\/inheritance-in-java.jpg\"},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/\",\"name\":\"Wikitechy\",\"description\":\"Interview Questions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757\",\"name\":\"Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"caption\":\"Editor\"},\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/author\/editor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Palak enters a coding competition she wants to write code to pass down","description":"Palak enters a coding competition she wants to write code to pass down values from one class to another - A class in Java can extend another class to become a subclass.","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.wikitechy.com\/interview-questions\/programming\/palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values-from-one-class-to-another-which-of-following-concept-should-she-use-to-do-so\/","og_locale":"en_US","og_type":"article","og_title":"Palak enters a coding competition she wants to write code to pass down","og_description":"Palak enters a coding competition she wants to write code to pass down values from one class to another - A class in Java can extend another class to become a subclass.","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values-from-one-class-to-another-which-of-following-concept-should-she-use-to-do-so\/","og_site_name":"Wikitechy","article_published_time":"2021-08-27T00:15:30+00:00","article_modified_time":"2021-09-03T09:17:48+00:00","og_image":[{"url":"https:\/\/cdn.wikitechy.com\/interview-questions\/programming\/inheritance-in-java.jpg"}],"author":"Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Editor","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values-from-one-class-to-another-which-of-following-concept-should-she-use-to-do-so\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values-from-one-class-to-another-which-of-following-concept-should-she-use-to-do-so\/","name":"Palak enters a coding competition she wants to write code to pass down","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values-from-one-class-to-another-which-of-following-concept-should-she-use-to-do-so\/#primaryimage"},"image":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values-from-one-class-to-another-which-of-following-concept-should-she-use-to-do-so\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.wikitechy.com\/interview-questions\/programming\/inheritance-in-java.jpg","datePublished":"2021-08-27T00:15:30+00:00","dateModified":"2021-09-03T09:17:48+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"description":"Palak enters a coding competition she wants to write code to pass down values from one class to another - A class in Java can extend another class to become a subclass.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/programming\/palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values-from-one-class-to-another-which-of-following-concept-should-she-use-to-do-so\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/palak-enters-a-coding-competition-she-wants-to-write-code-to-pass-down-values-from-one-class-to-another-which-of-following-concept-should-she-use-to-do-so\/#primaryimage","url":"https:\/\/cdn.wikitechy.com\/interview-questions\/programming\/inheritance-in-java.jpg","contentUrl":"https:\/\/cdn.wikitechy.com\/interview-questions\/programming\/inheritance-in-java.jpg"},{"@type":"WebSite","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website","url":"https:\/\/www.wikitechy.com\/interview-questions\/","name":"Wikitechy","description":"Interview Questions","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757","name":"Editor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","caption":"Editor"},"url":"https:\/\/www.wikitechy.com\/interview-questions\/author\/editor\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/2567","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/comments?post=2567"}],"version-history":[{"count":1,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/2567\/revisions"}],"predecessor-version":[{"id":2577,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/2567\/revisions\/2577"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=2567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=2567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=2567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}