The Add Constructor wizard helps you add a constructor method to a class file.

This wizard appears when you select Source > Add Constructor.

The following controls are available:

Access modifier Specifies the access mode that applies to the constructor:
  • Public — The constructor can be called from any code that has access to the class instance.
  • Package-Protected — The constructor can be called from the defining class, from a subclass, or from any class within its package.
  • Protected — The constructor can be called from the defining class or a subclass.
  • Package-Private — The constructor can be called from the defining class or any class within its package.
  • Private — The constructor 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.
Insert catch block If checked, adds a CATCH block to the generated method stub to support structured error handling.
Insert finally block If checked, adds a FINALLY block to the generated method stub to support structured error handling.
Insertion position Determines where the constructor code is inserted in the source file.