{"id":372,"date":"2021-07-12T22:28:07","date_gmt":"2021-07-12T22:28:07","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=372"},"modified":"2021-09-14T05:11:38","modified_gmt":"2021-09-14T05:11:38","slug":"which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default\/","title":{"rendered":"Which of the following access specifiers is used in a class definition by default ?"},"content":{"rendered":"<div class=\"row\">\n<div class=\"col-sm-12\">\n<div class=\"TextHeading\">\n<div class=\"hddn\">\n<h4 id=\"which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default\" class=\"color-pink\" style=\"text-align: justify;\">Which of the following access specifiers is used in a class definition by default ?<\/h4>\n<div class=\"row\" style=\"text-align: justify;\">\n<div class=\"col-sm-6\">\n<p>A. Protected<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>B. Public<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>C. Private<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>D. Friend<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3 id=\"answer-c-private\" style=\"text-align: justify;\"><b>Answer :\u00a0<\/b>C. Private<\/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><b>Public<\/b>\u00a0\u2013 The members declared as Public are accessible from outside the Class through an object of the class.<\/li>\n<li><b>Protected<\/b>\u00a0\u2013 The members declared as Protected are accessible from outside the class but only in a class derived from it.<\/li>\n<li><b>Private<\/b>\u00a0\u2013 These members are only accessible from within the class. No outside Access is allowed.<\/li>\n<li><b>Friend<\/b>\u00a0\u2013 A friend function of a class is defined outside that class scope but it has the right to access all private and protected members of the class.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"text-center row\" style=\"text-align: justify;\"><\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Answer : C. Private<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2080],"tags":[195,2329,2265,2324,2325,2332,2320,491,360,368,211,2255,199,198,363,2322,2327,205,2326,2117,220,222,2122,212,2120,2121,710,207,366,204,217,2116,2333,2262,2331,2330,16277,2123,210,200,2118,2321,2328,2318,2323,2319,968,216,2119],"class_list":["post-372","post","type-post","status-publish","format-standard","hentry","category-cpp","tag-accenture-interview-questions-and-answers","tag-access-specifier-in-c","tag-access-specifiers-in-c-inheritance","tag-access-specifiers-in-c-with-example-programaccess-specifiers-in-c","tag-access-specifiers-in-c-with-examples","tag-access-specifiers-in-oops-with-example","tag-access-specifiers-is-used-in-a-class-definition-by-default-in-c","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-protected-inheritance","tag-casting-networks-india-pvt-limited-interview-questions-and-answers","tag-chetu-interview-questions-and-answers","tag-ciena-corporation-interview-questions-and-answers","tag-default-access-specifier-in-c","tag-default-access-specifiers-in-c","tag-dell-international-services-india-pvt-ltd-interview-questions-and-answers","tag-difference-between-public-private-and-protected-in-c-with-example","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-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-private-member-function-in-c-with-example","tag-protected-in-c-with-example","tag-public-private-protected-c","tag-public-private-protected-inheritance-in-c","tag-sapient-technical-and-hr-interview-questions","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-what-is-correct-about-the-static-data-member-of-a-class","tag-which-access-specifier-is-implicitly-used-in-a-class","tag-which-access-specifiers-is-used-in-a-class-definition-by-default","tag-which-of-the-following-provides-a-reuse-mechanism","tag-which-of-these-is-a-function-defined-in-a-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 v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Which of the following access specifiers is used in a class definition<\/title>\n<meta name=\"description\" content=\"Which of the following access specifiers is used in a class definition by default ? - C++ Interview Questions - Private\" \/>\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-access-specifiers-is-used-in-a-class-definition-by-default\/\" \/>\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 access specifiers is used in a class definition\" \/>\n<meta property=\"og:description\" content=\"Which of the following access specifiers is used in a class definition by default ? - C++ Interview Questions - Private\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-12T22:28:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-14T05:11:38+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\":\"Article\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/cpp\\\/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/cpp\\\/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default\\\/\"},\"author\":{\"name\":\"Editor\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/4d5a581fb5470d1560324bddc5e8b757\"},\"headline\":\"Which of the following access specifiers is used in a class definition by default ?\",\"datePublished\":\"2021-07-12T22:28:07+00:00\",\"dateModified\":\"2021-09-14T05:11:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/cpp\\\/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default\\\/\"},\"wordCount\":125,\"commentCount\":0,\"keywords\":[\"Accenture interview questions and answers\",\"access specifier in c++\",\"access specifiers in c++ inheritance\",\"access specifiers in c++ with example programaccess specifiers in c++\",\"access specifiers in c++ with examples\",\"access specifiers in oops with example\",\"access specifiers is used in a class definition by default in c++\",\"Applied Materials interview questions and answers\",\"Atos interview questions and answers\",\"BMC Software interview questions and answers\",\"Bosch India Software interview questions and answers\",\"c++ protected inheritance\",\"CASTING NETWORKS INDIA PVT LIMITED interview questions and answers\",\"Chetu interview questions and answers\",\"Ciena Corporation interview questions and answers\",\"default access specifier in c++\",\"default access specifiers in c++\",\"Dell International Services India Pvt Ltd interview questions and answers\",\"difference between public private and protected in c++ with example\",\"eInfochips interview questions and answers\",\"Electronics Arts Inc interview questions and answers\",\"Flipkart interview questions and answers\",\"Harman International interview questions and answers\",\"Indecomm Global Services interview questions and answers\",\"Larsen &amp; Toubro interview questions and answers\",\"Mathworks India Private Limited interview questions and answers\",\"Mavenir interview questions and answers\",\"Mphasis interview questions and answers\",\"NetApp interview questions and answers\",\"Oracle Corporation interview questions and answers\",\"PeopleStrong interview questions and answers\",\"Philips Software Centre Pvt Ltd interview questions and answers\",\"private member function in c++ with example\",\"protected in c++ with example\",\"public private protected c++\",\"public private protected inheritance in c++\",\"Sapient Technical and HR Interview Questions\",\"SRM Technologies interview questions and answers\",\"Symphony Teleca interview questions and answers\",\"Tech Mahindra interview questions and answers\",\"Tecnotree interview questions and answers\",\"what is correct about the static data member of a class?\",\"which access specifier is implicitly used in a class\",\"which access specifiers is used in a class definition by default\",\"which of the following provides a reuse mechanism?\",\"which of these is a function defined in a class?\",\"Wipro Infotech interview questions and answers\",\"Wipro interview questions and answers\",\"Yash Technologies interview questions and answers\"],\"articleSection\":[\"C++\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/cpp\\\/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/cpp\\\/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default\\\/\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/cpp\\\/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default\\\/\",\"name\":\"Which of the following access specifiers is used in a class definition\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#website\"},\"datePublished\":\"2021-07-12T22:28:07+00:00\",\"dateModified\":\"2021-09-14T05:11:38+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/4d5a581fb5470d1560324bddc5e8b757\"},\"description\":\"Which of the following access specifiers is used in a class definition by default ? - C++ Interview Questions - Private\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/cpp\\\/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default\\\/\"]}]},{\"@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\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"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:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"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 access specifiers is used in a class definition","description":"Which of the following access specifiers is used in a class definition by default ? - C++ Interview Questions - Private","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-access-specifiers-is-used-in-a-class-definition-by-default\/","og_locale":"en_US","og_type":"article","og_title":"Which of the following access specifiers is used in a class definition","og_description":"Which of the following access specifiers is used in a class definition by default ? - C++ Interview Questions - Private","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default\/","og_site_name":"Wikitechy","article_published_time":"2021-07-12T22:28:07+00:00","article_modified_time":"2021-09-14T05:11:38+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":"Article","@id":"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default\/#article","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default\/"},"author":{"name":"Editor","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"headline":"Which of the following access specifiers is used in a class definition by default ?","datePublished":"2021-07-12T22:28:07+00:00","dateModified":"2021-09-14T05:11:38+00:00","mainEntityOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default\/"},"wordCount":125,"commentCount":0,"keywords":["Accenture interview questions and answers","access specifier in c++","access specifiers in c++ inheritance","access specifiers in c++ with example programaccess specifiers in c++","access specifiers in c++ with examples","access specifiers in oops with example","access specifiers is used in a class definition by default in c++","Applied Materials interview questions and answers","Atos interview questions and answers","BMC Software interview questions and answers","Bosch India Software interview questions and answers","c++ protected inheritance","CASTING NETWORKS INDIA PVT LIMITED interview questions and answers","Chetu interview questions and answers","Ciena Corporation interview questions and answers","default access specifier in c++","default access specifiers in c++","Dell International Services India Pvt Ltd interview questions and answers","difference between public private and protected in c++ with example","eInfochips interview questions and answers","Electronics Arts Inc interview questions and answers","Flipkart interview questions and answers","Harman International interview questions and answers","Indecomm Global Services interview questions and answers","Larsen &amp; Toubro interview questions and answers","Mathworks India Private Limited interview questions and answers","Mavenir interview questions and answers","Mphasis interview questions and answers","NetApp interview questions and answers","Oracle Corporation interview questions and answers","PeopleStrong interview questions and answers","Philips Software Centre Pvt Ltd interview questions and answers","private member function in c++ with example","protected in c++ with example","public private protected c++","public private protected inheritance in c++","Sapient Technical and HR Interview Questions","SRM Technologies interview questions and answers","Symphony Teleca interview questions and answers","Tech Mahindra interview questions and answers","Tecnotree interview questions and answers","what is correct about the static data member of a class?","which access specifier is implicitly used in a class","which access specifiers is used in a class definition by default","which of the following provides a reuse mechanism?","which of these is a function defined in a class?","Wipro Infotech interview questions and answers","Wipro interview questions and answers","Yash Technologies interview questions and answers"],"articleSection":["C++"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default\/","name":"Which of the following access specifiers is used in a class definition","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"datePublished":"2021-07-12T22:28:07+00:00","dateModified":"2021-09-14T05:11:38+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"description":"Which of the following access specifiers is used in a class definition by default ? - C++ Interview Questions - Private","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/cpp\/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default\/"]}]},{"@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":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"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:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","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\/372","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=372"}],"version-history":[{"count":3,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/372\/revisions"}],"predecessor-version":[{"id":3619,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/372\/revisions\/3619"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}