The Add Method wizard helps you add method code to a class file.

This wizard appears when you select Source > Add Method.

The following controls are available:

Method name (Required) Specifies the name of the method. The name must begin with a letter; spaces and most non-alphanumeric characters are not allowed.
Access modifier Specifies the access mode that applies to the method:
  • Public — The method can be called from any code that has access to the class instance.
  • Package-Protected — The method can be called from the defining class, from a subclass, or from any class within its package.
  • Protected — The method can be called from the defining class or a subclass.
  • Package-Private — The method can be called from the defining class or any class within its package.
  • Private — The method can be called by the defining class or another instance of the same class.
Note: The Package-Protected and Package-Private modifiers are only available if the class is inside a package.
Abstract (Enabled only if current class is abstract) If checked, specifies that the method is abstract and cannot be instantiated. An abstract event is designed to be inherited and to be implemented by the inheriting class. Therefore, an abstract event cannot be private, nor can it be static.
Static If checked, specifies that the method is static. A static event is accessible by every instance of the class and (if public) by clients of the class without the need to create an instance of the class.

A static method cannot be abstract.

Return type Specifies the method's return type.
Insert catch block If checked, adds a CATCH block to the generated method stub.
Insert finally block If checked, adds a FINALLY block to the generated method stub.
Insertion position Determines where the method code is inserted in the source file.