C++ Programming - OOPS Concepts - Discussion
Discussion Forum : OOPS Concepts - General Questions (Q.No. 15)
15.
Which of the following is an abstract data type?
Discussion:
20 comments Page 1 of 2.
Avijit said:
9 years ago
Characteristics of Abstract Class.
1. Abstract class cannot be instantiated, but pointers and references of Abstract class type can be created.
2. Abstract class can have normal functions and variables along with a pure virtual function.
3. Abstract classes are mainly used for Up casting, so that its derived classes can use its interface.
4. Classes inheriting an Abstract Class must implement all pure virtual functions, or else they will become Abstract too.
1. Abstract class cannot be instantiated, but pointers and references of Abstract class type can be created.
2. Abstract class can have normal functions and variables along with a pure virtual function.
3. Abstract classes are mainly used for Up casting, so that its derived classes can use its interface.
4. Classes inheriting an Abstract Class must implement all pure virtual functions, or else they will become Abstract too.
Sushil said:
1 decade ago
An abstract data type is defined as a mathematical model of the data objects that make up a data type as well as the functions that operate on these objects so we can say that class is the abstract data type in other words class contains both data members as well as member function hence class is abstract data type.
Sanket said:
8 years ago
An Abstract class means class which contains pure virtual function as a pure virtual function is having address zero if we try to create an object for the abstract class there is a chance to call pure virtual function which leads to segmentation fault so the object is restricted for abstract class.
(3)
Xzibit said:
1 decade ago
Abstract class means a class which can not have any object associated with it. But it can be inherited by other classes.
A class is basically said to be abstract class when it has at least one pure virtual function.
Eg:
class A
{
public:
virtual Func()=0;
};
A class is basically said to be abstract class when it has at least one pure virtual function.
Eg:
class A
{
public:
virtual Func()=0;
};
Saurabh Sakharkar said:
10 months ago
In the context of object-oriented programming, a class is considered an abstract data type (ADT). A class encapsulates data and functions into a single unit, allowing the user to create objects with specific properties and behaviors.
Bijay said:
1 decade ago
As per my understanding! what is use of abstract type, because we are putting some common elements & making a single element for the use of that one.
Shubham said:
1 decade ago
http://en.wikipedia.org/wiki/Abstract_data_type#Examples.
It says Strings is an abstract data type.
Why isn't strings given as answer then?
It says Strings is an abstract data type.
Why isn't strings given as answer then?
Varun said:
9 years ago
What is missing here? How the literal meaning of abstract and the class definition together make a new meaning? Please explain clearly.
Vedi G said:
5 years ago
In a class one pure virtual function is there that is call abstract class.
Pure virtual class means [virtual void add()=0;]
Pure virtual class means [virtual void add()=0;]
(1)
Pooja said:
9 years ago
According to me abstract means its hides the operation being performed in it. Class functions are abstract to us.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers