C++ Programming - OOPS Concepts - Discussion
Discussion Forum : OOPS Concepts - General Questions (Q.No. 8)
8.
How many instances of an abstract class can be created?
Discussion:
57 comments Page 2 of 6.
Prashant said:
9 years ago
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.
(5)
Abhishek singh said:
9 years ago
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.
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.
(1)
Basant said:
10 years ago
Is instance or object is same?
Basant said:
10 years ago
Can anyone write an executable program for abstract class?
Amol matre said:
1 decade ago
No object is created of abstract class it has no instance.
Blackpearl said:
1 decade ago
Can anyone provide simple programmer illustrating concept of abstract class?
Ronak said:
1 decade ago
So why we use abstract class can anyone explain?
(1)
Deepak Rana said:
1 decade ago
In abstract class object creation is not possible.
Govind Chaudhary said:
1 decade ago
Abstract class is a class which have body but not implementation.
So why we need to create object?
So why we need to create object?
Akshat Sharda said:
1 decade ago
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.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers