Le 20/08/2013 07:34, Xiangrong Fang a
écrit :
Yep: a class is a construct definig a collection of variables, properties and methods whilst an object is an instantiated class. TMyClass = class(TSomething) <<-------- this is a class public constructor Create; blabla end; var obj: TMyClass ; <<----------- this is a declared oblect which instantiates a class when created (see next line) ... Obj := TMyClass .Create; <<----- now the class TMyClass exists thru the Obj object In other words, a class is non existent whilst an object falls into the real world. A class describes, an object makes use of a class A class is unique bet there can be lots of objects instantiating a class These few words help to explain the basic difference even if some more technical explations couls be needed. AFAIK, all OOP languages use almost the same terminology This is why class procedures and functions exist. But this is another story. Antonio.
--
|
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal