<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":378,"date":"2021-07-12T22:41:41","date_gmt":"2021-07-12T22:41:41","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=378"},"modified":"2021-09-14T05:03:57","modified_gmt":"2021-09-14T05:03:57","slug":"which-of-the-following-statements-about-virtual-base-classes-is-correct","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-statements-about-virtual-base-classes-is-correct\/","title":{"rendered":"Which of the following statements about virtual base classes is correct ?"},"content":{"rendered":"<div class=\"TextHeading\">\n<div class=\"hddn\">\n<h3 id=\"which-of-the-following-statements-about-virtual-base-classes-is-correct\" class=\"color-pink\" style=\"text-align: justify;\">Which of the following statements about virtual base classes is correct ?<\/h3>\n<div class=\"row\" style=\"text-align: justify;\">\n<div class=\"col-sm-12\">\n<p>A. It is used to provide multiple inheritance .<\/p>\n<\/div>\n<div class=\"col-sm-12\">\n<p>B. It is used to avoid multiple copies of base class in derived class .<\/p>\n<\/div>\n<div class=\"col-sm-12\">\n<p>C. It is used to allow multiple copies of base class in a derived class.<\/p>\n<\/div>\n<div class=\"col-sm-12\">\n<p>D. It allows private members of the base class to be inherited in the derived class.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3 id=\"answer-b-it-is-used-to-avoid-multiple-copies-of-base-class-in-derived-class\" style=\"text-align: justify;\"><b>Answer :\u00a0<\/b>B. It is used to avoid multiple copies of base class in derived class .<\/h3>\n<div class=\"subheading\" style=\"text-align: justify;\">\n<h2 id=\"explanation\">Explanation<\/h2>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>When two or more objects are derived from a common base class, we can prevent multiple copies of the base class being present in an object derived from those objects by declaring the base class as virtual when it is being inherited such a base class is known as virtual base class.<\/li>\n<li>Virtual base classes, used in virtual inheritance, is a way of preventing multiple &#8220;instances&#8221; of a given class appearing in an inheritance hierarchy when using multiple inheritance.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"ImageContent\">\n<div class=\"hddn\"><img decoding=\"async\" class=\"img-responsive center-block aligncenter\" src=\"https:\/\/cdn.wikitechy.com\/interview-questions\/cpp\/virtual-base-class-in-cpp.png\" alt=\" Virtual Base Class\" \/><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Answer : B. It is used to avoid multiple copies of base class in derived class.<\/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":[2080],"tags":[195,491,360,368,211,2368,199,198,363,205,2117,220,222,2122,2373,2374,212,2120,2121,710,207,366,204,217,2116,16277,2364,2123,210,200,2118,2363,2371,2372,2367,2369,2290,2370,2366,968,216,2119],"class_list":["post-378","post","type-post","status-publish","format-standard","hentry","category-cpp","tag-accenture-interview-questions-and-answers","tag-applied-materials-interview-questions-and-answers","tag-atos-interview-questions-and-answers","tag-bmc-software-interview-questions-and-answers","tag-bosch-india-software-interview-questions-and-answers","tag-c-virtual-base-class","tag-casting-networks-india-pvt-limited-interview-questions-and-answers","tag-chetu-interview-questions-and-answers","tag-ciena-corporation-interview-questions-and-answers","tag-dell-international-services-india-pvt-ltd-interview-questions-and-answers","tag-einfochips-interview-questions-and-answers","tag-electronics-arts-inc-interview-questions-and-answers","tag-flipkart-interview-questions-and-answers","tag-harman-international-interview-questions-and-answers","tag-how-virtual-base-class-works-in-c","tag-in-c-what-is-a-virtual-base-class","tag-indecomm-global-services-interview-questions-and-answers","tag-larsen-toubro-interview-questions-and-answers","tag-mathworks-india-private-limited-interview-questions-and-answers","tag-mavenir-interview-questions-and-answers","tag-mphasis-interview-questions-and-answers","tag-netapp-interview-questions-and-answers","tag-oracle-corporation-interview-questions-and-answers","tag-peoplestrong-interview-questions-and-answers","tag-philips-software-centre-pvt-ltd-interview-questions-and-answers","tag-sapient-technical-and-hr-interview-questions","tag-significance-of-virtual-base-class","tag-srm-technologies-interview-questions-and-answers","tag-symphony-teleca-interview-questions-and-answers","tag-tech-mahindra-interview-questions-and-answers","tag-tecnotree-interview-questions-and-answers","tag-virtual-base-class","tag-virtual-base-class-in-c","tag-virtual-base-class-in-c-with-example-program","tag-virtual-base-classes","tag-virtual-class","tag-virtual-class-in-c","tag-virtual-function-in-c","tag-what-is-a-virtual-base-class","tag-wipro-infotech-interview-questions-and-answers","tag-wipro-interview-questions-and-answers","tag-yash-technologies-interview-questions-and-answers"],"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 statements about virtual base classes is correct ?<\/title>\n<meta name=\"description\" content=\"Which of the following statements about virtual base classes is correct ? - When two or more objects are derived from a common base class\" \/>\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\/cpp\/which-of-the-following-statements-about-virtual-base-classes-is-correct\/\" \/>\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 statements about virtual base classes is correct ?\" \/>\n<meta property=\"og:description\" content=\"Which of the following statements about virtual base classes is correct ? - When two or more objects are derived from a common base class\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-statements-about-virtual-base-classes-is-correct\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-12T22:41:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-14T05:03:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.wikitechy.com\/interview-questions\/cpp\/virtual-base-class-in-cpp.png\" \/>\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\/cpp\/which-of-the-following-statements-about-virtual-base-classes-is-correct\/\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-statements-about-virtual-base-classes-is-correct\/\",\"name\":\"Which of the following statements about virtual base classes is correct ?\",\"isPartOf\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-statements-about-virtual-base-classes-is-correct\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-statements-about-virtual-base-classes-is-correct\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdn.wikitechy.com\/interview-questions\/cpp\/virtual-base-class-in-cpp.png\",\"datePublished\":\"2021-07-12T22:41:41+00:00\",\"dateModified\":\"2021-09-14T05:03:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757\"},\"description\":\"Which of the following statements about virtual base classes is correct ? - When two or more objects are derived from a common base class\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-statements-about-virtual-base-classes-is-correct\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-statements-about-virtual-base-classes-is-correct\/#primaryimage\",\"url\":\"https:\/\/cdn.wikitechy.com\/interview-questions\/cpp\/virtual-base-class-in-cpp.png\",\"contentUrl\":\"https:\/\/cdn.wikitechy.com\/interview-questions\/cpp\/virtual-base-class-in-cpp.png\"},{\"@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 statements about virtual base classes is correct ?","description":"Which of the following statements about virtual base classes is correct ? - When two or more objects are derived from a common base class","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\/cpp\/which-of-the-following-statements-about-virtual-base-classes-is-correct\/","og_locale":"en_US","og_type":"article","og_title":"Which of the following statements about virtual base classes is correct ?","og_description":"Which of the following statements about virtual base classes is correct ? - When two or more objects are derived from a common base class","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-statements-about-virtual-base-classes-is-correct\/","og_site_name":"Wikitechy","article_published_time":"2021-07-12T22:41:41+00:00","article_modified_time":"2021-09-14T05:03:57+00:00","og_image":[{"url":"https:\/\/cdn.wikitechy.com\/interview-questions\/cpp\/virtual-base-class-in-cpp.png"}],"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\/cpp\/which-of-the-following-statements-about-virtual-base-classes-is-correct\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-statements-about-virtual-base-classes-is-correct\/","name":"Which of the following statements about virtual base classes is correct ?","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-statements-about-virtual-base-classes-is-correct\/#primaryimage"},"image":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-statements-about-virtual-base-classes-is-correct\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.wikitechy.com\/interview-questions\/cpp\/virtual-base-class-in-cpp.png","datePublished":"2021-07-12T22:41:41+00:00","dateModified":"2021-09-14T05:03:57+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"description":"Which of the following statements about virtual base classes is correct ? - When two or more objects are derived from a common base class","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-statements-about-virtual-base-classes-is-correct\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-statements-about-virtual-base-classes-is-correct\/#primaryimage","url":"https:\/\/cdn.wikitechy.com\/interview-questions\/cpp\/virtual-base-class-in-cpp.png","contentUrl":"https:\/\/cdn.wikitechy.com\/interview-questions\/cpp\/virtual-base-class-in-cpp.png"},{"@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\/378","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=378"}],"version-history":[{"count":3,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/378\/revisions"}],"predecessor-version":[{"id":3613,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/378\/revisions\/3613"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}