Question
please I want the solution for all this multiple choice , in C++ language Question 2) When class B is inherited from class A, what
please I want the solution for all this multiple choice , in C++ language
Question 2)
When class B is inherited from class A, what is the order in which the destructor of those classes are executed
- Which of the following cannot be overloaded?
A. member functions
B. constructors
C. destructors
D. BandC
- The default access level assigned to members of a class is ___________
A. Private
B. Public
C. Protected
D. Needs to be assigned
4. For which type of class private and protected members of the class can be accessed from outside the same class in which they are declared
A. No such class exist
B. Friend
C. Static
D. Virtual
5. Which of the following is not allowed
A. SomeClass[] f1() { . . . }
B. SomeClass * f1() { . . . }
C. SomeClass f1() { . . . }
D. SomeClass f1(int h) { . . . }
6. Given the following class:
class Example {
public: int a,b,c;
};
int main() {
Example * obj1 = new Example(1);
Example * obj2 = new Example(1,3);
Example * obj3 = new Example(1,6,7);
return 0;
}
If we have to define only one constructor to make the main work, which one of the following will work ?
A. Example(int a=1 , int b = 2, int )
B. Example(int a=1 , int b, int)
C. Example(int a , int b = 2, int c=9)
D. None of the above
7. To create an Abstract class, we need to have
A. Copy constructor
B. Friend constructor
C. Virtual function
D. Pure virtual function
8. To speed up passing large objects between two functions, we can use
A. Pass by value
B. Pass by reference
C. Pass by pointer
D. BandC
9. Inside a function definition for a member function of an object with data element x, which of the following is equivalent to this->x:
A. (*this).x
B. *this->x
C. x
D. Both A and C are correct
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started