Wednesday, 18 December 2013

Abstract classes in ax 2009

Abstract classes
An Abstract class is used when the developer wishes to ensure that a particular class cannot be instantiated. This applies when sub-classes will be created which contain the real functionality, and it is meaningless to create an instance of the parent class.
A class is declared as abstract in the Class Declaration.
abstract class AJ_Abstract
{
  int x;//X is integer
}
As can be seen in the example, it is possible to put variable declarations inside an abstract class. It is also possible to add both abstract and concrete (non-abstract) methods on that class.
It is not possible to instantiate an object of this class.

abstractObject = new AJ_Abstract()


Ex:- RunBase class ,RunBaseBatch class

No comments:

Post a Comment