Tuesday, November 11, 2014

Difference between Overloading and Overriding

Overloading and overriding is done on methods and variables in classes.

Overloading: overloading of method is writing the same method with different number or different types of arguments in the same class. the method name will be same but arguments types or no. of arguments will be different.
X++ does not support method overloading and can't be used in AXAPTA.

Overriding: Overriding is writing a method implemented in parent class again in child class. 
Note that the parent class method again implemented in child class . So the method signature remains same and will not change. If we try the no. of arguments or type of arguments in child class we will get unexpected results.  

No comments:

Post a Comment

Enable/Disable form control based on multiple rows select

 class PurchTableFormEventHandler {      [FormDataSourceEventHandler(formDataSourceStr(PurchTable, PurchTable), FormDataSourceEventType::Act...