Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is polymorphism?
Message
De
28/03/1999 17:32:01
 
 
À
28/03/1999 01:24:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00200864
Message ID:
00202856
Vues:
16
Yes, but you'll have a list of Objects and just that. Even if your lists have always all their objects of some other types, the lists contain only Objects. So, your code will have to be full of casts, instanceof tests, etc.

A template is a little more. You can write a list class in a generic way and instanciate lists of any other types. So, the compiler can check a lot more things and you don't have to use casts or runtime type checks.

Although, the fact that all classes derive from Object is excelent in Java.

Vlad

>I'd use the Object type. Java has generic containter classes that don't rely on templates.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform