Apex Class

What is Apex Class?


  • It is a collection of variables and library of methods that can be reused.
  • Apex is a strongly typed object-oriented programming language and it will run on Force.com platform.
  • class keyword is used to define an Apex class.
Below is the example to create a simple class :

public class ClassName
{
        
       //Body of the Apex class.
       //Here we can define variables and methods.

}


How to create an Apex class in Salesforce:-

  1. Login to your Salesforce account.
  2. Go to setup.
  3. Search for Apex in Quick Find/Search box then clicks on Apex Classes.




   4. Then clicks on the New button.


   5. Write an Apex code.
   6. Clicks on the save button.




      

Comments