Computer Programming/Generic programming

From Wikibooks, open books for an open world
Jump to: navigation, search

Generic Programming is a style of programming where algorithms and other programming bits use unspecified data and class types. This means that one could write a function such as Multiply<T>(T a, T b) and later pass on an integer as a and b, or a long integer, or any other type of variable. This is most useful in strongly-typed languages, as weakly-typed languages have no need for them.