Hello!
If I have an interface Ia and Ib in this way
interface Ia : Ib
Here we say that interface Ia implements interface Ib
If I have a base class called Base and a derived class called Derived we
have
class Derived : Base
Here we say that the Derived class inherit the Base class
Now to my question if I have an abstract class MyAbstractClass where some
members are abstract like this
class MyClass : MyAbstractClass
Do we say that MyClass inherit or implements
According to me we would say that we implement abstract members from the
MyAbstractClass and
inherit not abstract members but that would mean using both words.
So what is the best terminologi to use(implement or inherit or both) when
the base class is an abstract class
//Tony 4 1134
An interface may inherit multiple other interfaces
A class may inherit (subclass) a single other (base) class
A class may implement multiple interfaces
A class may be a concrete subclass of an abstract base class (or any
permutation...)
Marc
Personally I would say inherit in all these cases.
Ia inherits Ib (there is no implementation in Ia)
DerivedClass inherits BaseClass even if the base class is abstract
Class implements interface
In VB you are also using the keywords 'Inherits' and 'Implements' in this way.
--
Happy Coding!
Morten Wennevik [C# MVP]
"Tony" wrote:
Hello!
If I have an interface Ia and Ib in this way
interface Ia : Ib
Here we say that interface Ia implements interface Ib
If I have a base class called Base and a derived class called Derived we
have
class Derived : Base
Here we say that the Derived class inherit the Base class
Now to my question if I have an abstract class MyAbstractClass where some
members are abstract like this
class MyClass : MyAbstractClass
Do we say that MyClass inherit or implements
According to me we would say that we implement abstract members from the
MyAbstractClass and
inherit not abstract members but that would mean using both words.
So what is the best terminologi to use(implement or inherit or both) when
the base class is an abstract class
//Tony
On Jun 10, 10:46 am, Marc Gravell <marc.grav...@g mail.comwrote:
An interface may inherit multiple other interfaces
A class may inherit (subclass) a single other (base) class
A class may implement multiple interfaces
A class may be a concrete subclass of an abstract base class (or any
permutation...)
I've never liked "inherit a base class". If you think of normal
personal inheritance, you don't inherit a parent - you inherit items
*from* a parent.
I personally like:
ICollection extends IEnumerable
MemoryStream derives from Stream
Stream implements IDisposable
MemoryStream is a concrete class derived from Stream
The spec says "inherits from" for the interface. (1.9, 13.1.3)
10.3.3 specifies both derivation and extension: "A derived class
extends its direct base class." (I think the subtlety here is that
MemoryStream derives from Object but doesn't extend it; it both
derives from and extends Stream.) Subclass is only used as a noun in
the spec.
Eric Lippert doesn't like "extends" for interfaces: http://csharpindepth.com/ViewNote.aspx?NoteID=28
(On the page I claim that "extends" is correct as per the spec - I'm
not sure where I got that from though, and I should probably fix it.)
Jon
On Jun 10, 3:43 pm, "Jon Skeet [C# MVP]" <sk...@pobox.co mwrote:
I personally like:
ICollection extends IEnumerable
MemoryStream derives from Stream
Stream implements IDisposable
MemoryStream is a concrete class derived from Stream
The spec says "inherits from" for the interface. (1.9, 13.1.3)
10.3.3 specifies both derivation and extension: "A derived class
extends its direct base class." (I think the subtlety here is that
MemoryStream derives from Object but doesn't extend it; it both
derives from and extends Stream.) Subclass is only used as a noun in
the spec.
Eric Lippert doesn't like "extends" for interfaces:http://csharpindepth.com/ViewNote.aspx?NoteID=28
(On the page I claim that "extends" is correct as per the spec - I'm
not sure where I got that from though, and I should probably fix it.)
I also tend to lean towards either "implies" or "requires" for
interfaces; i.e. "ICollectio n implies IEnumerable", or "ICollectio n
requires IEnumerable". In practice, due to the way interfaces are
handled internally in CLR, it makes more sense (have you noticed how,
if you do Type.GetInterfa ces(), you get a flat list of all implemented
interfaces, and not just the "most derived" ones?). This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: wired |
last post by:
Hi,
I've just taught myself C++, so I haven't learnt much about style or
the like from any single source, and I'm quite styleless as a result.
But at the same time, I really want nice code and I go to great
lengths to restructure my code just to look concise and make it more
manageable.
When I say this, I'm also referring to the way I write my functions.
It seems to me sometimes that I shouldn't have many void functions
accepting...
|
by: Gene Ellis |
last post by:
Something strange is happening, but I bet it is a quick fix. My
favicon image is showing up in the URL bar, for a couple of seconds,
but then it disappears and the default browser icon is displayed. When
I reload the page, the same thing happens. The correct icon appears
for a few seconds (while the page is loading), but then goes away. You
can see that here:
http://webdev.ucop.edu/tltc_ph2/index_icon.html
|
by: Aguilar, James |
last post by:
Hello all,
To begin, yes, this -is- a homework assignment. However, it is for my
Algorithms class, and my instructor has given us explicit permission to use
"expert" groups like newsgroups, so if that's your only reason not to help,
please do. Otherwise, I guess it's OK. But, just remember, I'm not asking
you to do my work for me, just to point out my error.
My problem is not with the algorithm itself (standard divide and conquer on...
|
by: ccdrbrg |
last post by:
This is a rather general subject, I apologize.
I am new to XHTML, CSS, et al and I am having trouble
understanding the DTD and xml namespace declarations.
For example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DT¬D/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
by: Matt |
last post by:
I have 2 questions:
1. strlen returns an unsigned (size_t) quantity. Why is an unsigned
value more approprate than a signed value? Why is unsighned value less
appropriate?
2. Would there be any advantage in having strcat and strcpy return a
pointer to the "end" of the destination string rather than returning a
| |
by: Sahil Malik [MVP] |
last post by:
Public Private Key Pairs - How do they work?
-----------------------------------------------
I was looking at a presentation recently in which it was suggested that -
User 1 Encrypts a message using User 2's Public Key.
User 2 Decrypts the transmission using his Private Key to get the orignal
message.
Is the above correct?
|
by: KraftDiner |
last post by:
I was under the assumption that everything in python was a refrence...
so if I code this:
lst =
for i in lst:
if i==2:
i = 4
print lst
I though the contents of lst would be modified.. (After reading that
|
by: Jeff |
last post by:
In the function below, can size ever be 0 (zero)?
char *clc_strdup(const char * CLC_RESTRICT s)
{
size_t size;
char *p;
clc_assert_not_null(clc_strdup, s);
size = strlen(s) + 1;
|
by: Tony Johansson |
last post by:
Hello!
I'm reading in a book and they use definition sometimes and declaration
sometimes.
I just want to use the correct terminologi when I talk about these kind of
things.
Below is an example from a book.
The two rows that begin with public delegate void...
and
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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 we have to send another system
| |