C++ Programming - OOPS Concepts - Discussion

Discussion Forum : OOPS Concepts - General Questions (Q.No. 4)
4.
Which of the following is not the member of class?
Static function
Friend function
Const function
Virtual function
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
42 comments Page 3 of 5.

Arati said:   4 years ago
I think static is correct.

Amruta said:   1 decade ago
In a class, the private data can be accessed only by the public member function of that class. c++ provides a mechanism in which a non member can have access to the private member of a class. This is achieved by the non_member function "friend" to the class, whose private data can be accessed.

Yogeshwar bargal said:   1 decade ago
I dont know what is cont class?

Srikanth said:   1 decade ago
A const function is one, which doesn't allow any modification or change its instance variable's data (member data).

Selvakumar said:   1 decade ago
What is virtual function ?

Kavita said:   1 decade ago
I agree with Amruta and virtual function is used for dynamic binding. If a virtual function is defined in the base class, it need not be necessarily redefined in the derived class. In such cases, class will invoke the base function.

Maha said:   1 decade ago
Why we are using virtual function in dynamic binding ?

Mohamed Rafeek said:   1 decade ago
In a class, the private data can be accessed only by the public member function of that class. C++ provides a mechanism in which a non member can have access to the private member of a class. This is achieved by the non_member function "friend" to the class, whose private data can be accessed.

Sandesh said:   1 decade ago
A const member function cannot modify any of the data members of its class. This is used by programmers to prevent accidental modification of data members.

One more thing is that const memb function can modify only those data members that are declared as mutable.

Yogesh said:   1 decade ago
Virtual function can be used in derived class.


Post your comments here:

Your comments will be displayed after verification.