>>>>The only thing Java added
>>>>to C++ was a little bit of (not nearly enough) error-resistance.
>>So what is the difference between a Java Interface and a C++ pure virtual
>class (apart from the C++ version being less restrictive)?

>Well, consider the following declaration:
>  public class GentleThread implements Runnable {
>    ...
>    }
>How do you say that in C++ ? I.e., what in C++ corresponds to "implements" ?

In C++, implements would simply be denoted by subclassing Runnable so you'd

class GentleThread : public Runnable {

Interfaces (and 'implements') are essentially Java's way of avoiding the
problems associated with multiple inheritance. The subtlety is that in Java you
can implement as many interfaces as you like, but you can only extend a single
class. In C++ you can extend multiple classes (and take the blame when the whole
thing blows up in your face :-)


This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender
immediately by telephoning +44(1252) 373232. You should not copy it
or use it for any purpose nor disclose or distribute its contents to
any other person.