Create New Apex Class

To launch the Create New Apex Class wizard, select File | New | Apex Class or right-click your project and choose New | Apex Class. The wizard allows you to choose a template for the new class.

Field Description
Name Enter a name for the class. Salesforce recommends following Java standards for naming, that is, classes start with a capital letter, methods start with a lower-case verb, and variables have meaningful names. It is not legal to define a class and interface with the same name in the same class, or an inner class with the same name as its outer class. However, since methods and variables have their own namespaces within the class, it is legal for a variable, method, and a class within a class to have the same name.
Version Select the version of the API this object conforms to from the dropdown list.
Template Optional. Select a template for the Apex class from the drop-down list:
  • Default - Creates a class without a template.
  • Test Class - Creates a class with the @isTest annotation. Classes defined with the @isTest annotation do not count against the organization size limit for Apex scripts.
  • Inbound Email Client - Creates a class that processes the contents, headers, and attachments of inbound e-mail.