473,320 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How sub classes of abstract classes interact?

any subclass of an abstract class must either implement all of the abstract methods in the superclass or be iteself declared abstract why?
Nov 22 '10 #1
1 1262
Nepomuk
3,112 Expert 2GB
Basically, an abstract class is a sort of template. In it, it says "any class that uses me will have the following functions, variables, etc.". Everything accessing a subclass of this will therefore assume, that these functions, variables, etc. exist - which will only be the case, if you implemented them.

Of course, you can have another abstract class, that has all stuff that that other one had plus something more - that would be ok without having to implement the functions, because it's still just a "template".

There is also something called an "Interface", which solves similar problems. To read up on both Interfaces and abstract classes, I'd recommend this article.

Greetings,
Nepomuk
Nov 22 '10 #2

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

Similar topics

4
by: wesley | last post by:
Hi, Why must abstract classes implements all the methods/property in the interface it implements? Since it's an abstract class it shouldn't be able to be instantiated and the child classes are...
3
by: Uzytkownik | last post by:
I've class C1, C2 and C3. C1 should be abstract, and all functions should be defined like normal, no-virtual functions. It don't have to have constructor. C2 is C1 with constructor. C3 is C2 with...
2
by: newsgroper | last post by:
I have an abstract class with some abstract methods. I created another class that derives from the abstract method. In the derived class I have overridden all the abstract methods. However, I...
4
by: C.E.O. Gargantua | last post by:
I want to have a member property that is common to a set of classes. I designed an abstract class, but when I try to add it to the abstract class, it flags an error in VS.NET. The design (...
3
by: bubby | last post by:
I have a database interface class (an abstract class) that has two derived classes that work with two different types of databases. If the dervied classes have managed, and unmanged resources and...
7
by: erin.sebastian | last post by:
Hello Everyone, This is my first attempt at coding using an abstract class and i am getting an error i can't figure out. Here is the back ground. I have a project that contains an abstract...
4
by: skishorev | last post by:
and what is object delagation, and how it can implemented?
7
by: gordon | last post by:
Hi I am working through some course notes for a msdn training course in C# and I am a little stuck with the differences between an abstract class and an interface. Could someone please give...
4
by: N.RATNAKAR | last post by:
hai, what is abstract class and abstract method
5
by: Tony Johansson | last post by:
Hello! Here I have an Interface called ITest and a class called MyClass which derive this intrface. As you can see I don't implement this method myTest in class MyClass because i use the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.