<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":2571,"date":"2021-08-27T00:23:45","date_gmt":"2021-08-27T00:23:45","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=2571"},"modified":"2021-09-03T07:21:43","modified_gmt":"2021-09-03T07:21:43","slug":"which-of-the-following-cannot-be-inherited","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/which-of-the-following-cannot-be-inherited\/","title":{"rendered":"Which of the following cannot be inherited ?"},"content":{"rendered":"<div class=\"TextHeading\">\n<div class=\"hddn\">\n<p class=\"color-pink\">Which of the following cannot be inherited ?<\/p>\n<div class=\"row\">\n<div class=\"col-sm-6\">\n<p>A. Friend<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>B. Static<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>C. Destructor<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>D. Constructor<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3 id=\"answer-c-destructor\"><b>Answer :\u00a0<\/b>C. Destructor<\/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><b>Friend Class<\/b>\u00a0&#8211; A friend class can access private and protected members of other class in which it is declared as friend. It is sometimes useful to allow a particular class to access private members of other class.<\/li>\n<li><b>Constructor<\/b>\u00a0&#8211; A constructor is a member function of a class which initializes objects of a class. In C++, Constructor is automatically called when object (instance of class) create. It is special member function of the class.<\/li>\n<li><b>Static<\/b>\u00a0&#8211; Static categories are sealed and thus can&#8217;t be transmissible. They can not inherit from any category except Object. Static categories cannot contain associate instance constructor. but, they will have a static builder.<\/li>\n<li><b>Destructor<\/b>\u00a0&#8211; Destructor is a member function which destructs or deletes an object.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Answer :\u00a0C. Destructor<\/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":[1816,16035,16037,16036,16038,16039,16031,16033,16034,16276,16040,16028,16030,16029,16032,16041,16042,16043,16044,16045,16046,16047,16048],"class_list":["post-2571","post","type-post","status-publish","format-standard","hentry","category-programming","tag-c-interview-questions","tag-c-programming-questions-and-answers","tag-c-programming-theory-questions-and-answers","tag-c-programming-viva-questions-and-answers","tag-c-what-type-of-classes-cannot-be-inherited-in-net","tag-c-what-we-cannot-inherit-from-a-base-class","tag-coding-interview-questions","tag-interview-questions-to-ask-a-computer-programmer","tag-java-interview-questionsc-programming-interview-questions-and-answers-with-explanations","tag-most-asked-sapient-nitro-interview-questions","tag-prevent-class-inheritance-in-c","tag-programming-interview-questions-and-answers","tag-programming-interview-questions-c","tag-programming-interview-questions-java","tag-programming-technical-interview-questionsc-programming-interview-questions-and-answers","tag-what-is-not-inherited-in-c","tag-what-is-not-inherited-in-java","tag-which-class-cannot-be-inherited-in-java","tag-which-class-that-cannot-be-inherited","tag-which-members-are-not-inherited-in-a-child-class","tag-which-of-the-following-can-be-inherited-by-a-derived-class-from-a-base-class","tag-which-of-the-following-cannot-be-inherited-form-base-class","tag-which-of-the-following-cannot-be-inherited-from-the-base-class"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Which of the following cannot be inherited ? - Programming - Wikitechy<\/title>\n<meta name=\"description\" content=\"Which of the following cannot be inherited ? - A friend class can access private and protected members of other class in which it is declared as friend.\" \/>\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\/which-of-the-following-cannot-be-inherited\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Which of the following cannot be inherited ? - Programming - Wikitechy\" \/>\n<meta property=\"og:description\" content=\"Which of the following cannot be inherited ? - A friend class can access private and protected members of other class in which it is declared as friend.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/programming\/which-of-the-following-cannot-be-inherited\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-27T00:23:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-03T07:21:43+00:00\" \/>\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\/which-of-the-following-cannot-be-inherited\/\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/programming\/which-of-the-following-cannot-be-inherited\/\",\"name\":\"Which of the following cannot be inherited ? - Programming - Wikitechy\",\"isPartOf\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\"},\"datePublished\":\"2021-08-27T00:23:45+00:00\",\"dateModified\":\"2021-09-03T07:21:43+00:00\",\"author\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757\"},\"description\":\"Which of the following cannot be inherited ? - A friend class can access private and protected members of other class in which it is declared as friend.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wikitechy.com\/interview-questions\/programming\/which-of-the-following-cannot-be-inherited\/\"]}]},{\"@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":"Which of the following cannot be inherited ? - Programming - Wikitechy","description":"Which of the following cannot be inherited ? - A friend class can access private and protected members of other class in which it is declared as friend.","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\/which-of-the-following-cannot-be-inherited\/","og_locale":"en_US","og_type":"article","og_title":"Which of the following cannot be inherited ? - Programming - Wikitechy","og_description":"Which of the following cannot be inherited ? - A friend class can access private and protected members of other class in which it is declared as friend.","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/which-of-the-following-cannot-be-inherited\/","og_site_name":"Wikitechy","article_published_time":"2021-08-27T00:23:45+00:00","article_modified_time":"2021-09-03T07:21:43+00:00","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\/which-of-the-following-cannot-be-inherited\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/which-of-the-following-cannot-be-inherited\/","name":"Which of the following cannot be inherited ? - Programming - Wikitechy","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"datePublished":"2021-08-27T00:23:45+00:00","dateModified":"2021-09-03T07:21:43+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"description":"Which of the following cannot be inherited ? - A friend class can access private and protected members of other class in which it is declared as friend.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/programming\/which-of-the-following-cannot-be-inherited\/"]}]},{"@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\/2571","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=2571"}],"version-history":[{"count":2,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/2571\/revisions"}],"predecessor-version":[{"id":2687,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/2571\/revisions\/2687"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=2571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=2571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=2571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}