Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change protected method to public in child class ?
Message
De
17/06/1998 07:51:56
 
 
À
17/06/1998 07:40:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00108991
Message ID:
00108995
Vues:
36
>In one of these subclasses I would like PutData() >to be a public method. Is this possible ? > >My workaround for now is to create another method for the child class, Put(), that calls PutData() of the base class. This may give me problems later, if I would change PutData() in the base class. Therefore, I'd like a better solution. > If your asking whether you can change a Protected method to a Public method within code, no. The method wouldn't be protected if you could change it. [g] I'm just wondering, why would your Put() method give you problems later? If you change PutData() in at a later date, all calls to Put() can be changed to accomodate Put() changes just once. Sounds good to me. >By the way, is this right ? >* Protected methods cannot be executed by the user, but can be executed in the method code of the class or it's child classes. >* Hidden methods are only accessible in the class itself. >(I'm used to C++, therefore I'm a bit confused.) > I believe this is correct. I use Public methods all the time. (Could be a bad habit.)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform