The Source for Java Technology Collaboration
User: Password:



Start New Message Delete Post a Reply

Article: 
 (Not So) Stupid Questions 5: Inheritance Versus Interfaces
Subject:  language support
Date:  2005-10-13 11:58:57
From:  dog


If it is true that delegation should be preferred over inheritance, then there should be a language supported way to do it easily (since the language should support best practices). For example:

class MyClass {
 
    // this would make method1() work from this
    // object
    delegate OtherClass.method1;

}


 Feed java.net RSS Feeds