methods

In OO parlance, the term method is used to denote a function within a class.

 

If a class 's methods were to become increasingly large it could make the code difficult to read, and it is therefore common practice to declare prototypes for the methods inline (i.e. within the class) and to then define the implementation of the methods outside of the class's body, to then be accessed using the :: scope resolution operator.

 

Compile & Run:

myTriangle width was set at 12
myTriangle height was set at 2000
myTriangle area: 12000

Leave a Reply