Mike Yearwood
Toronto, Ontario, Canada
Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Virtual environment:
VMWare
>>Classes are for when there's data that must travel with the code. No point using a class for a bunch of functions that don't share data.
>
>In OOP "data" refers to the properties of the object. These could also exist in an abstract class.
>
Embolded: Nope.
Properties CANNOT exist in an abstract class, as the abstract class (at least in the languages that have such a keyword as Java and C#, signifying at least an abstract member or a compiler check that only non-abstract decendants can be instantiated) cannot be instantiated via new or corresponding ways.
To be nit-picking correct in such languages you can define properties in the abstract class, but they EXIST only in the instantiated object, which is of a different class. In a language like vfp having no inner concept of "abstract class" you can comment/name a class as "abstract", but as soon as you instantiate it, it is no longer abstract in the OOP sense ;-)))
Or you could say, nothing exists in the "Blueprint"
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement