Writing Apex code – object-oriented programming in Apex
As in most OOP languages, classes are templates through which objects are instantiated that contain attributes and methods. Class methods or attributes can be invoked by other Apex scripts within the same organization except methods that have the webservice
keyword. The webservice
methods are available externally to the organization. Classes are stored with the version of the API used to compile them. Classes have an isValid
flag that is true if dependent metadata has not changed since compilation. Classes may contain one level of inner classes. Inner class is a way of organizing the classes (same as the package in Java).
Creating Apex code
Apex classes can be created and edited through the Setup menu of the organization and Force.com IDE and Developer Console. You can interact with Apex classes via the setup page by navigating to Setup | Develop | Apex Classes. You will see the following screenshot:
You can...