Re: Terminology
From: Dave Harris (brangdon_at_cix.co.uk)
Date: 12/24/03
- Previous message: Harry Erwin: "TDD and Refactoring"
- In reply to: universe_at_covad.net: "Re: Terminology"
- Next in thread: Rick: "Re: Terminology"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 24 Dec 2003 13:06 +0000 (GMT Standard Time)
universe@covad.net () wrote (abridged):
> You didn't say anything about MI in what I replied to.
Here it is again:
Another difference is that Java tends to combine different
methods if they have the same name and signature. For
example:
interface Interface {
public void method();
}
class Impl {
public void method() {}
}
class Derived implements Interface extends Impl {
// No definition of method here!
}
The final class, Derived, has two parents: Interface and Impl. That is
Java code. It is an example of multiple inheritance (of interface and
implementation). The corresponding C++ would be like:
class Interface {
public:
virtual void method() = 0;
};
class Impl {
public:
virtual void method() {}
};
class Derived: public Interface, public Impl {
public:
virtual void method() {
Impl::method();
}
};
Again we see the multiple inheritance. Without the definition of
Derived::method(), Derived would be an abstract class in C++ even though
it isn't in Java.
So you are wrong to say there was no multiple inheritance in my article.
Perhaps you just missed it through not knowing Java very well (that is why
I now include the C++ version). I have snipped the rest of your reply,
because it is all based on the same misconception, and anyway mostly just
repeats what you said earlier. I know you like to think you can teach me
C++, but I wish you wouldn't.
-- Dave Harris, Nottingham, UK
- Previous message: Harry Erwin: "TDD and Refactoring"
- In reply to: universe_at_covad.net: "Re: Terminology"
- Next in thread: Rick: "Re: Terminology"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|