Vai al contenuto

Methods Polimorphysm

GF_ProjectVX code can handle polimorphysm with classes, to do so you’ll have to use the reference data type (see paragraph 11.1.2.1).Create a variable of type reference to the father class; now valorize it usign the reference of a child class; now you can use the reference variable to call a method (or to access the class properties), GF_ProjectVX code will be able to recognize which is the correct method to call. Methods Polimorphysm-image_0In this example, fRef^.method_1() will call method_1 of fb_Class_2 even if fRef is a refer- ence to fb_Class_1.