473,498 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is the purpose of abstract classes and when are they used?

4 New Member
More specifically, say I have classes Animal, Bird, and Parrot...

Parrot "is-a" Bird
and
Bird "is-a" Animal

I am not given any other information and I have to decide which are superclasses, subclasses, abstract, or concrete (may have multiple answers).

I know Animal is a superclass and Parrot is a subclass, but what is class Bird? This confuses me because it's caught in the middle so is it both (subclass of Animal, but superclass of Parrot? Or just a subclass?).

What REALLY confuses me is which ones are abstract or concrete.
I have no idea when/in-what-situations I am supposed to use abstract classes and all the giberish online is not helping me (that and I left my inclass notes on my school computer in the classroom...). What I mean, is that the online FAQ is not in a very "noob-friendly" language and it merely confuses me further.

Could someone please tell me in layman's terms when to use superclasses, subclasses, abstract classes, and concrete classes in the example above?
Oct 10 '10 #1
1 2587
Dheeraj Joshi
1,123 Recognized Expert Top Contributor
Animal class is a super class
Bird class is a child class
Parrot class is a grand child class.

There are certain set of functionalities which are in Animal class need to be there in Parrot. Like breathing.

This link may help you a bit regarding abstract classes.

If you have any other questions please post back.

This is a good tutorial to start with.

Regards
Dheeraj Joshi
Oct 11 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1804
by: f00sion | last post by:
I found a good tutorial of how to supply the objects without having the implementation files on the client. This was working great until I realized that I couldnt use any constructors with server...
8
2242
by: Vishal Gandhi | last post by:
Hi , Please help me by advising an real life scenario where Abstract Classes should be used over Interfaces or vice versa . Whats the basic difference between Abstract Class and interface other...
9
2289
by: Christian Christmann | last post by:
Hi, I've a class Handler which contains a STL list std::list<Abstract*> mAbstract; which is storing elements of the abstract class Abstract. Further this class has a getElement function to...
12
3064
by: Daedalus.OS | last post by:
Ok first I'm pretty new to OOP, so my question may sound stupid to some of you. If the only answer you can provide is "get a book about OOP" then don't loose your time and mine cause it's already...
3
1780
by: WithPit | last post by:
I am trying to create an managed wrapper but have some problems with it by using abstract classes. In my unmanaged library code i had the following three classes with the following hierarchy ...
2
2466
by: tony | last post by:
Hello!! I know what an abstract class is which mean that the one of the derived class must define the abstract methods in the abstract class. So all the abstract methods in the abstarct class...
4
3187
by: N.RATNAKAR | last post by:
hai, what is abstract class and abstract method
4
1846
by: Eric | last post by:
I was wondering what people thought about the information found at: http://g.oswego.edu/dl/mood/C++AsIDL.html Specifically, I am interested in the following recommendation: ---- Since...
6
4009
by: Miguel Guedes | last post by:
Hello, I recently read an interview with Bjarne Stroustrup in which he says that pure abstract classes should *not* contain any data. However, I have found that at times situations are when it...
5
2987
by: =?Utf-8?B?UmljaA==?= | last post by:
Greetings, I am actually a VB.Net guy, but I have worked somewhat with C++ and C#. I just want to ask about the relationship between Abstract Classes and Interfaces. My first question is if...
1
6890
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4915
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4593
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3095
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1423
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
657
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
292
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.