An object-oriented ABL class (.cls) file defines a strongly-typed class or interface. A class definition encapsulates state and behavior. A class can define data members and properties that represent the state of the class and a set of related methods and events that provide the behavior of the class. A class has one or more constructors which accept parameters, a destructor with no parameters and one or more methods that may accept parameters or return a value. The same code block structure and statements used in procedures are also used in classes.

CLASS foo:

  METHOD PUBLIC VOID bar ( ):
     <method-body>
  END METHOD.
  
  <class-body>
  
END CLASS.

An interface definition declares prototypes for a set of data members, methods, and events but does not provide the code for the methods and events. Interfaces are used to create a consistent contract among classes that implement the interface.

A class (.cls) file is compiled and executes in the AVM. The compiled class is also called an r-code (.r) file.

For more information, see Get Started with Classes, Interfaces, and Objects.