The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+2 votes
949 views

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
in Object Oriented Programming by Veteran (103k points)
recategorized | 949 views

2 Answers

+2 votes
Best answer
Ans is A

 Making at least one member function as pure virtual function
by Boss (48.5k points)
selected by
+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!!

by Boss (32.2k points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,362 questions
55,786 answers
192,411 comments
90,919 users