Cpp Programming Quiz 127 – Which of the following means “The use of an object of one class in definition of another class”?
[B]. Inheritance[C]. Composition
[D]. Abstraction
Answer: Option C
Answer: Option C
Answer: Option D
Answer: Option D
[A]. Only 1 is correct.
[B]. Only 2 is correct.[C]. Both 1 and 2 are correct.
[D]. Both 1 and 2 are incorrect.
Answer: Option A
class Bix
{
public:
static void MyFunction();
};
int main()
{
void(*ptr)() = &Bix::MyFunction;
return 0;
}
[A].The program reports an error as pointer to member function cannot be defined outside the definition of class.
[B].The program reports an error as pointer to static member function cannot be defined.
[C].The program reports an error as pointer to member function cannot be defined without object.
[D].The program reports linker error.
Answer: Option D
Answer: Option D
[A]. Only II is correct.
[B]. Both I and II are correct.[C]. Only I is correct.
[D]. Both I and II are incorrect.
Answer: Option C