previous | index | next

Static Methods

Since static methods are not called on objects, they often serve the purpose of being utility methods.

To promote cohesion, static methods are oftened gathered together in one class, as in the Nim project's Utils class:

class Utils {
public:
    static string intToString(int i);
    static int generateRandomInt(int min, int max);
};


previous | index | next