next up previous
Next: 2.2.2 Using interface/class parameters Up: 2.2 Approximating Generics in Previous: 2.2 Approximating Generics in

2.2.1 Using class Object

A generic class parameter in a C++ template can be straightforwardly translated into Java by turning it into a parameter of type Object, the root of the Java class hierarchy. However this translation is only approximate since the Java class types are reference types [18] as explained below.

Refer to the Java utility classes such as java.util.Vector, java.util.Stack,
[4] java.util.Hashtable, etc for more examples.


next up previous
Next: 2.2.2 Using interface/class parameters Up: 2.2 Approximating Generics in Previous: 2.2 Approximating Generics in
T. K. Prasad