recategorized
2,924 views
2 votes
2 votes

Which of the following is used to make an Abstract class?

  1. Making at least one member function as pure virtual function
  2. Making at least one member function as virtual function
  3. Declaring as Abstract class using virtual keyword
  4. Declaring as Abstract class using static keyword
recategorized

2 Answers

2 votes
2 votes

Answer must be B

  • Abstract class is the one which doesn't have any object.
  • Pure virtual function is the one which doesn't have any definition. It should be overridden in derived class.
  • A pure virtual function is declared by using a pure specifier (= 0)  eg; void foo()=0;

So by making at least one pure virtual function a class becomes abstract!!

Answer:

Related questions

1 votes
1 votes
1 answer
2
go_editor asked Aug 10, 2016
1,293 views
Match the following with reference to object oriented modelling :$\begin{array}{clcl} & \textbf{List-I} && \textbf{List-II} \\ \text{(a)} & \text{Polymorphism} & \text{(...