Exercise: Objects And Classes

Questions for: Objects And Classes

Which of the following also known as an instance of a class?
A:
Friend Functions
B:
Object
C:
Member Functions
D:
Member Variables
Answer: B
No answer description is available. Let's discuss.
Which of the following type of data member can be shared by all instances of its class?
A:
Public
B:
Inherited
C:
Static
D:
Friend
Answer: C
No answer description is available. Let's discuss.
Which of the following can access private data members or member functions of a class?
A:
Any function in the program.
B:
All global functions in the program.
C:
Any member function of that class.
D:
Only public member functions of that class.
Answer: C
No answer description is available. Let's discuss.
Which of the following keywords is used to control access to a class member?
A:
Default
B:
Break
C:
Protected
D:
Asm
Answer: C
No answer description is available. Let's discuss.
Which of the following statement is correct with respect to the use of friend keyword inside a class?
A:
A private data member can be declared as a friend.
B:
A class may be declared as a friend.
C:
An object may be declared as a friend.
D:
We can use friend keyword as a class name.
Answer: B
No answer description is available. Let's discuss.
Ad Slot (Above Pagination)
Quiz