NagaNimesh wrote:
i searched got a conclusion but have a doubt
t=what is abstract data types????????? will u tell me??????
Abstract are not just data types; abstract are some types, those which are not intended for instantiation. In some languages, it is syntactically indicated and inferred for derived types, so accidental creation of the type's instance is prevented. The purpose is to use them only as the base types for other types.
Besides, using them as
compile-time types representing elements of some set of objects is used for
polymorphism. In this case, the members of the abstract base class (strictly speaking, it does not have to be abstract at all, it could be pseudo-abstract, that is, sometime instantiated for some purposes; it's only important that it is a base of all the
runtime types of the set) are used as a common interface for all objects of the set. All operations with these objects are therefore should be performed only through these common members (casting to more derived type is considered as OOP violation; it could be used but is the best avoided; better code design should be used instead). Another mechanism,
late binding, is used to hook up the more specialized methods and properties specific to all the runtime types, these specific methods or properties should always be
virtual; late binding is actually the heard of OOP.
Another, alternative kind of compile-time type representing polymorphic set is the interface type.
From the above, you should be able to see that asking separate questions like yours are not very useful. One aspect hooks up another one, at it goes this way until you cover all OOP. OOP cannot be learned as list of topics, only
holistic approach can be used. Very often, traditional OOP teaching creates false impression that there are difference pillars in OOP paradigm, but in reality this is not so. All concepts are interdependent and need to be learned together. I would advise to start it with reading one single book, from the beginning to the very end.
—SA