Inheritance question

negerns negerns2000 at gmail.com
Mon Aug 20 08:47:25 PDT 2007


How do I hide A's getname()and use another method name for it? I wanted 
the user of my class B to use the getnewname() instead of using 
getname() which is inherited from class A.

     class A {
       private char[] _name;
       public char[] getname() { return _name; }
       ...
     }

     class B : A {
       public char[] getnewname() { return A.getname(); }
       ...
     }

     void main() {
       B b;
       ...
       writefln(b.getnewname());
     }


-- 
negerns


More information about the Digitalmars-d-learn mailing list