Compartilhar via


Classes in X++

Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

A class is a software construct that defines the data and methods of the specific concrete objects that are subsequently constructed from that class. The data represents the state of the object. The methods represent the behavior of the object.

Variables are the data for the class. Variables in an X++ class are specific to objects that are constructed from that class. Every object constructed from the class declaration has its own copy of the variables. Such variables are known as instance variables. You cannot declare static variables in X++.

Methods are the sequences of statements that operate on the data. Methods are typically declared to operate on the instance variables of the class, and are known as instance methods or object methods. In X++ you can also declare static methods.

In This Section

Declaration of Classes

Constructors

Destructors

Creating a Subclass

Tables as Classes

See also

Methods in X++

Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.