June 2004
Intermediate to advanced
848 pages
21h 28m
English
Methods are the OOP name for functions. A method is always declared inside a class; methods can't exist outside a class. A method has this general form:

The parts marked “opt” in the previous example are optional, and we will deal with these in due course. An example method may look like this:
void setValue(int i) { something = i;}
The main routine, where execution starts, is another example:

What's the difference between an argument and a parameter? Here's a bit of terminology which is ...
Read now
Unlock full access