Effects of Generic Types Specialization on Program Behavior

Free registration required

Executive Summary

Generic types are a language feature of Java that allows writing program code that is parameterized over types. The Java implementation of generic types uses a mechanism called type erasure. Type erasure creates a single instance of a generic class, removing all type specific usage information (e.g. whether it is used with strings or integers). The compiler inserts typecasts to guarantee type-safe calls to instances of the generic class. Since most of the optimizations in the Java programming language are performed at run-time, Java programs using generic classes are slower than they would have been under an implementation that uses type specialized classes.

  • Format: PDF
  • Size: 268.9 KB