In the constructors, methods or destructor of a class, you can access any other method defined in the class. If a method returns a value, you can use that value anywhere in your code.

Here is the syntax for calling a class method from within a class:

:<method>( [ <parameter>][,…])

Syntax

Description

method

The name of the method in this instance of the class.

parameter

Zero or more values that are passed to the method at runtime. You must specify the same number of parameters, in the same order, and with the same types as in the definition of the method.