previous | start | next

2.2 Template Classes

Our intArray class has int as the type of array elements.

If we wanted a intArray with a different type, we would have to change the int type to the new different type, but otherwise there would be no change to the code.

For example we might want a array of LineItem's. So the substitute for the int data type would be: LineItem.



previous | start | next