gs gs111 OOps Access Specifiers - OOPs MCQ: Protected Access Specifier - Quiz No.1

gs gs111 OOP Object Oriented Programming Java Quiz

Online Quizzes Preparation

This quiz belongs to book/course code gs gs111 OOP Object Oriented Programming Java of gs organization. We have 178 quizzes available related to the book/course OOP Object Oriented Programming Java. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic OOps Access Specifiers. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.

NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.

Question 1: Which among the following best describes the protected specifier?
Question 2: If a constructor is defined in protected access, then?
Question 3: For the following code, choose the correct option.

 class A { int marks; protected : A() { marks=100; } public : A( int x) { marks=x; } }; 
Question 4: If the protected members are to be made accessible only to the nearest subclass and no further subclasses, which access specifier should be used in inheritance?
Question 6: Which among the following is true for the given code below?

 class A { protected : int marks; public : A() { marks=100; } disp() { cout<<”marks=”<<marks; } }; class B: protected A { }; B b; b.disp(); 
Question 7: Protected members differ from default members as _______
Question 8: If all the members are defined in protected specifier then? (Constructors not considered)
Question 9: Which among the following is correct for the code given?

 class A { private: int marks; A() { } Public : disp() { cout<< marks; } }; class B: public A { } B b; 
Question 10: If protected inheritance is used then _____


Online Quizzes of gs111 OOP Object Oriented Programming Java

Other LANG related online quizzes

Other categories of gs Online Quizzes

Other organizations

Theme Customizer

Gaussian Texture



Gradient Background