C++ Programming - Objects and Classes - Discussion

Discussion :: Objects and Classes - General Questions (Q.No.5)


How can we make a class abstract?

[A]. By making all member functions constant.
[B]. By making at least one member function as pure virtual function.
[C]. By declaring it abstract using the static keyword.
[D]. By declaring it abstract using the virtual keyword.

Answer: Option B


No answer description available for this question.

Ajay said: (Dec 7, 2012)  
What you actually mean by abstract?

Giri said: (Apr 3, 2013)  
Abstract means pure virtual class.

Saurabh said: (Sep 3, 2013)  
Ya it means pure virtual class.

Maake Lethabo said: (Sep 11, 2013)  
OK then what is the different between the static keyword and pure virtual class?

Kavi said: (Dec 25, 2013)  
What is mean by least member function?

Keshav said: (Feb 26, 2014)  
Abstract class is the one which doesn't have any object. And pure virtual function is the one which doesn't have any definition in the base class but it is overridden in derived class.

So by defining pure virtual class, how can we make it abstract because we can still create an object of the class and make it normal class.

Kavya said: (Oct 2, 2014)  
Abstract class is one which does not have any object and in which we can only declare the function but cannot define it.

So by making at least one pure virtual function we can define it in its derived class and by making object of that derived class we can access that function.

Vahid said: (Jan 15, 2016)  
Can we define at least one method in abstract class?

Hemant said: (Jun 15, 2017)  
Can you give me a syntax?

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.