C++ Programming - OOPS Concepts - Discussion

Discussion :: OOPS Concepts - General Questions (Q.No.8)

8. 

How many instances of an abstract class can be created?

[A]. 1
[B]. 5
[C]. 13
[D]. 0

Answer: Option D

Explanation:

No answer description available for this question.

Agile said: (Apr 29, 2012)  
Abstract Class is Half Define Class.
It Has a rule Never Create a Object or Instances

Vipin said: (May 11, 2012)  
Abstract class not allowed to create an Instance (Object).
So, we can not create any instance then answer is 0.

Avinash said: (Jun 15, 2012)  
There are no objects for abstract class.

Nikita Choudhary said: (Jul 1, 2012)  
No objects an be created for abstract class, besides abstract class is not defined class. Its practically similar to the noun abstract which cannot create any members within it.

Nutan Singh said: (Jul 9, 2012)  
ABSTRACT class is a class which can not have any object.
CONCRETE class is a class which have its object.

Pooja said: (Jul 11, 2012)  
In abstract class object can't be created. Abstract classes cannot be used for:

1) Variables or member data.
2) Argument types.
3) Function return types.
4) Types of explicit conversions.

Inder said: (Jul 17, 2012)  
Abstract class is the class which has no arguments so it has no object.

Sowmya Vn said: (Jul 18, 2012)  
We can't create a instance class for abstract class and once we mention the class is abstract even we can't create the object for that class.

Sanjay Rajpurohir said: (Aug 24, 2012)  
Abstract class not allowed to create an Instance (Object).

Lucky said: (Aug 29, 2012)  
Abstract class is a zero objects class.

Sri said: (Sep 28, 2012)  
In my view a parent class does not have any direct instance it means abstract class can be used to creation of subclasses.

Mohammed said: (Oct 20, 2012)  
Abstract base class may be used only as framework from which other class will be derived, while the individual objects of this class will never be instantiated.

Aakash Gupta said: (Nov 5, 2012)  
Talking in terms of java, an abstract class can have any number of instances but can't have any object. But since this question. Is listed in oops concept, option d is correct.

Shivhari M.N Tholbare said: (Nov 23, 2012)  
What is actual use of abstract class?

Priyanka Bamne said: (Jan 3, 2013)  
Abstract classes are basically used for reusability concept while developing a software.

Lahu Pande said: (Feb 9, 2013)  
We cannot create the instance of the abstract class, only we can create reference of an abstract class.

Yoshwa Khyriem said: (Feb 14, 2013)  
Abstract classes can be created, signified, or simulated in several ways: By use of the explicit keyword abstract in the class definition, as in Java, D.

Suraja said: (Feb 21, 2013)  
Memory Allocation to the class members is done when its object is created. For an abstract class, memory cannot be allocated as its resource requirement cannot be calculated. Hence no object for an abstract class.

Wilson said: (Feb 23, 2013)  
Abstract class is not a main class to automatically create a object, only create reference to that particular class itself.

Rachana Singh said: (Feb 23, 2013)  
According to me. We cannot create the object of the abstract class but we can create many time instances of the abstract class.

Prashant Indolia said: (Jun 16, 2013)  
We can not create object of an abstract class because abstract class is incomplete class.

Amit said: (Jul 1, 2013)  
What is reusability concept and what are the uses of abstract class?

Prashant Patle said: (Jul 4, 2013)  
Why we use abstract class?

Mukul Rawal said: (Jul 28, 2013)  
Abstract Class just act as a base class to the derived class/classes.

Pvn B091086 said: (Aug 21, 2013)  
Abstract Class is act like a base class to the derived classes;

So, we can't create any instance to Abstract class.

Kousalya said: (Oct 9, 2013)  
Explain about the reusability concepts.

Zeba Desai said: (Jan 19, 2014)  
Abstract class have only declaration, no any definition. Without any body or definition we cannot create instances.

Priyanka said: (Feb 14, 2014)  
Can anyone tell me the exact implementation scenario where abstract class is used?

Rajaram said: (Mar 22, 2014)  
When a class is act as a parent class for all other classes and it should not be get instantiated by any derived class.

Basavaraj said: (Apr 2, 2014)  
Abstract class never allowed to create an instance, hence answer is 0.

Bhavik said: (Apr 29, 2014)  
Can you tell me why we can't create the instance of an abstract class?

Abdul Rizwan said: (May 10, 2014)  
@Bhavik.

Abstract class is used to reduce the complexity of method overriding or data hiding.

As we know abstract method don't have definition part, so for define the abstract method we must have to inherit the abstract class with some other base class.

And suppose we are able to create an object of an abstract class and we are calling the abstract method using object then in that abstract method don't have code so compiler will stuck and your program will hang over there.

So to reduce the problem or programmer don't make any mistake, Developer has put the restriction to create an object of an abstract class.

Instead of object we can create a reference variable of abstract class. Using ref variable also we can call abstract method but before calling we need to pass an object of base class to a ref variable.

Aditya Bhonde said: (Aug 8, 2014)  
To access a member function of abstract class we need not require a object. By creating a pointer of object we can call it or access it.

Jitendra Kumar Singh said: (Aug 9, 2014)  
May anyone explain with examples?

K2U2007 said: (Oct 16, 2014)  
A class that contains at least one pure virtual function is said to be abstract. Because an abstract class contains one or more functions for which there is no definition (that is, a pure virtual function), no objects of an abstract class may be created.

Instead, an abstract class constitutes an incomplete type that is used as a foundation for derived classes. Although you cannot create objects of an abstract class, you can create pointers.

And references to an abstract class. This allows abstract classes to support run-time. polymorphism, which relies upon base-class pointers and references to select the proper virtual function.

Dnyaneshwar Jadhav said: (Jan 16, 2015)  
By declaring class as a abstract we can not create any object belonging to that class.

Priya said: (Feb 10, 2015)  
Explain difference between instance of class and object of class?

Akshat Sharda said: (Mar 14, 2015)  
Object of only those class are created in which all the functions are declared. As we know that in abstract class we only declare the functions, the definition of function are given by inherited class.

Govind Chaudhary said: (Jun 12, 2015)  
Abstract class is a class which have body but not implementation.

So why we need to create object?

Deepak Rana said: (Jun 15, 2015)  
In abstract class object creation is not possible.

Ronak said: (Jul 14, 2015)  
So why we use abstract class can anyone explain?

Blackpearl said: (Aug 9, 2015)  
Can anyone provide simple programmer illustrating concept of abstract class?

Amol Matre said: (Aug 17, 2015)  
No object is created of abstract class it has no instance.

Basant said: (Oct 6, 2015)  
Can anyone write an executable program for abstract class?

Basant said: (Oct 6, 2015)  
Is instance or object is same?

Abhishek Singh said: (Jul 16, 2016)  
Abstract Class: A class is called as abstract class if it must have one or more abstract method.

Abstract method: Method which we just declare but not define, every class which inherits abstract class containing abstract method must define that method in its own way.

Abstract class can't have an instance object or variable because if we create an object of abstract class and using that object if we try to access abstract method then we will get compile time error as we don't have anything inside abstract method of that abstract class.

Prashant said: (Aug 11, 2016)  
So let's say we have a team creating a big project and we want the whole team to create many classes but they all must inherit a single BASE class for some particular functionality like debugging. So if we would create an abstract class which has only one virtual function which gives a debugging interface and inherits this is in all the other team's classes it would be easier. Why virtual because the derived classes could also have the same function with the same signature.

Hassan Maha said: (Mar 1, 2017)  
Which class has maximum instances, Can anyone tell the types of class having instances?

Raj Kumar Sepat said: (Apr 11, 2017)  
We can not create the instance of the Abstract Class.

So answer will be zero (o) instance of the abstract class.

Manilkumar said: (May 31, 2017)  
The abstract class contains at least one pure virtual function.

The pure virtual function by using a pure specifier ( = 0 ).

Ashitosh said: (Feb 11, 2018)  
How many objects can be created from an abstract class?

Fuad Al Masud said: (Nov 1, 2018)  
An abstract class is a private class which is used by admin panel.

Madhu said: (Nov 13, 2018)  
An abstract class does not have any instance of a class.

Venkatesh said: (Jan 31, 2019)  
Explain the Difference between class instance & class object.

Faiz said: (Mar 30, 2020)  
Anyone explain it with examples.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.