TheFreeSite.com!

Monday, July 28, 2008

Chapter 11: Run-time type identification

Java run-time type identification (RTTI) lets you find the exact type of an object
when you have a handle to only the base type. Normally, you’ll want to
intentionally ignore the exact type of an object and let Java’s dynamic binding
mechanism (polymorphism) implement the correct behavior for that type. But
occasionally it is very helpful to know the exact type of an object for which you
have only a base handle. Often this information allows you to perform a special case
operation more efficiently. This chapter explains what RTTI is for, how to use it
and how to get rid of it when it doesn’t belong there. In addition, the Java 1.1
reflection feature is introduced.

0 comments:

Tell Me Doubts In Java