Class and Object
Test
Model Test
Ebook
Index
C++ Home
Basic
31
Input and Output
3
Class and Object
12
OOP
4
Libraries and Namespaces
2
Data Structure
1
Schools
Ebook
Question:
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
Friend
B
Static
C
Virtual
D
No such class exist
Note:
Not available
Show answer
Show Note
Report
Question:
Which of the following cannot be inherited form the base class?
A
Constructor
B
Friend function
C
Both Constructor and Friend cannot be inherited
D
Static member function
Note:
Not available
Show answer
Show Note
Report
Question:
Which type of class has only one unique value for all the objects of that same class?
A
this
B
friend
C
static
D
this and friend
Note:
Not available
Show answer
Show Note
Report
Question:
Under what conditions a destructor destroys an objects?
A
Scope of existence has finished
B
Object dynamically assigned and it is released using the operator delete.
C
Program terminated.
D
None
Note:
Not available
Show answer
Show Note
Report
Question:
What is constructor?
A
A class automatically called whenever a new object of this class is created.
B
A class automatically called whenever a new object of this class is destroyed.
C
A function automatically called when a new object of this class is created.
D
A function automatically called whenever a new object of this class is destroyed.
Note:
Not available
Show answer
Show Note
Report
Question:
What is virtual member?
A
A member of a friend class that can be redefined in its derived classes.
B
A member of a virtual class that cannot be redefined in its derived classes.
C
A member of a static class that can be redefined in its derived classes.
D
A member of a class that can be redefined in its derived classes.
Note:
Not available
Show answer
Show Note
Report
Question:
Which operator is used to define a member of a class from outside the class definition itself?
A
::
B
:
C
>>
D
<<
Note:
Not available
Show answer
Show Note
Report
Question:
How would you read the expression x.y as?
A
member y of object pointer by x
B
member y of object x
C
member x of object y
D
none
Note:
Not available
Show answer
Show Note
Report
Question:
How do we define a destructor?
A
X~() {}
B
X() {}~
C
X() ~{}
D
~X() {}
Note:
Not available
Show answer
Show Note
Report
Question:
In C++ two different functions can have the same name if their parameter types are same.
A
True
B
False
Note:
Not available
Show answer
Show Note
Report
First
Prev
1
2
Next
Last
/2
Go
Schools
App Store
Whiteboard
Blogs
Quiz
Test
Apply Course
Games
Freelancers
Professionals
Newspapers
Terms
Privacy
Copyright © 2024. Powered by
Intellect Software Ltd