📄 tij0119.html
字号:
<html><body>
<table width="100%"><tr>
<td>
<a href="http://www.bruceeckel.com/javabook.html">Bruce Eckel's Thinking in Java</a>
</td>
<td align="right">
<a href="tij_c.html">Contents</a> | <a href="tij0118.html">Prev</a> | <a href="tij0120.html">Next</a>
</td>
</tr></table>
<hr>
<H1 ALIGN=LEFT>
11:
Run-time type identification
</H1>
<DIV ALIGN=LEFT><FONT FACE="Calligraph421 BT" SIZE=4 COLOR="Black">The
idea of run-time type identification (RTTI) seems fairly simple at first: it
lets you find the exact type of an object when you have a handle to only the
base type.
</FONT><P></DIV><DIV ALIGN=LEFT><FONT FACE="Carmina Md BT" SIZE=3 COLOR="Black">However,
the
</FONT><FONT FACE="Carmina Md BT" SIZE=3 COLOR="Black"><I>need</I></FONT><FONT FACE="Carmina Md BT" SIZE=3 COLOR="Black">
for RTTI uncovers a whole plethora of interesting (and often perplexing) OO
design issues and raises fundamental questions of how you should structure your
programs.
</FONT><P></DIV><DIV ALIGN=LEFT><FONT FACE="Carmina Md BT" SIZE=3 COLOR="Black">This
chapter looks at the ways that Java allows you to discover information about
objects and classes at run-time. This takes two forms:
“traditional” RTTI, which assumes that you have all the types
available at compile-time and run-time, and the “reflection”
mechanism in Java 1.1,<A NAME="Index1353"></A>
which allows you to discover class information solely at run-time. The
“traditional” RTTI will be covered first, followed by a discussion
of reflection.
</FONT><a name="_Toc375545405"></a><a name="_Toc408018645"></a><P></DIV>
<div align="right">
<a href="tij_c.html">Contents</a> | <a href="tij0118.html">Prev</a> | <a href="tij0120.html">Next</a>
</div>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -