📄 tij0084.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="tij0083.html">Prev</a> | <a href="tij0085.html">Next</a>
</td>
</tr></table>
<hr>
<H2 ALIGN=LEFT>
Summary</H2>
<DIV ALIGN=LEFT><FONT FACE="Carmina Md BT" SIZE=3 COLOR="Black">Polymorphism
<A NAME="Index715"></A>means
“different forms.” In object-oriented programming, you have the
same face (the common interface in the base class) and different forms using
that face: the different versions of the dynamically-bound methods.
</FONT><P></DIV><DIV ALIGN=LEFT><FONT FACE="Carmina Md BT" SIZE=3 COLOR="Black">You’ve
seen in this chapter that it’s impossible to understand, or even create,
an example of polymorphism without using data abstraction and inheritance.
Polymorphism is a feature that cannot be viewed in isolation (like a
</FONT><FONT FACE="Carmina Md BT" SIZE=3 COLOR="Black"><B>switch</B></FONT><FONT FACE="Carmina Md BT" SIZE=3 COLOR="Black">
statement, for example), but instead works only in concert, as part of a
“big picture” of class relationships. People are often confused by
other, non-object-oriented features of Java, like method overloading, which are
sometimes presented as object-oriented. Don’t be fooled: If it
isn’t late binding, it isn’t polymorphism.
</FONT><P></DIV><DIV ALIGN=LEFT><FONT FACE="Carmina Md BT" SIZE=3 COLOR="Black">To
use polymorphism, and thus object-oriented techniques, effectively in your
programs you must expand your view of programming to include not just members
and messages of an individual class, but also the commonality among classes and
their relationships with each other. Although this requires significant effort,
it’s a worthy struggle, because the results are faster program
development, better code organization, extensible programs, and easier code
maintenance.
</FONT><a name="_Toc375545345"></a><a name="_Toc408018561"></a><P></DIV>
<div align="right">
<a href="tij_c.html">Contents</a> | <a href="tij0083.html">Prev</a> | <a href="tij0085.html">Next</a>
</div>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -