page596.html

来自「wqeqwvrw rkjqhwrjwq jkhrjqwhrwq jkhrwq」· HTML 代码 · 共 47 行

HTML
47
字号
<HTML>
<HEAD>
<TITLE>Objects and Classes</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
 <img src="cover75.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/cover75.gif" alt="Logo" align=right>
<b>Data Structures and Algorithms 
with Object-Oriented Design Patterns in C++</b><br>
<A NAME="tex2html9268" HREF="page597.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page597.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="next_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/next_motif.gif"></A> <A NAME="tex2html9266" HREF="javascript:if(confirm('http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page586.html  \n\nThis file was not retrieved by Teleport Pro, because the server reports that an error occurred that prevented retrieval.  \n\nDo you want to open it from the server?'))window.location='http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page586.html'" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page586.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="up_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/up_motif.gif"></A> <A NAME="tex2html9260" HREF="page595.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page595.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/previous_motif.gif"></A> <A NAME="tex2html9270" HREF="page9.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page9.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/contents_motif.gif"></A> <A NAME="tex2html9271" HREF="page620.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page620.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="index_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/index_motif.gif"></A> <BR><HR>
<H1><A NAME="SECTION0018300000000000000000">Objects and Classes</A></H1>
<P>
``An <em>object</em><A NAME=57206>&#160;</A> is a region of storage[<A HREF="page619.html#ellis" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page619.html#ellis">12</A>].''
The <em>type</em> of the object determines how that region of storage
is interpreted and how it can be manipulated.
C++ provides <em>built-in types</em><A NAME=57210>&#160;</A>,
such as <tt>char</tt>, <tt>int</tt> and <tt>float</tt>,
and it supports the creation of <em>user-defined types</em>
using the <tt>class</tt> construct.
<P>
The <tt>class</tt> construct is what makes
C++ an <em>object-oriented</em> language.
A C++ class definition groups a set of values with a set of operations.
Classes facilitate modularity and information hiding.
The user of a class manipulates object instances of that class only
through a well-defined interface.
<P>
It is often the case that different classes possess common features.
Different classes may share common values;
they may perform the same operations;
they may support common interfaces.
In C++ such relationships are expressed using
<em>derivation</em> and <em>inheritance</em>.
<P>
<BR> <HR>
<UL> 
<LI> <A NAME="tex2html9272" HREF="page597.html#SECTION0018310000000000000000" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page597.html#SECTION0018310000000000000000">Member Variables and Member Functions</A>
<LI> <A NAME="tex2html9273" HREF="page598.html#SECTION0018320000000000000000" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page598.html#SECTION0018320000000000000000">Constructors and Destructors</A>
<LI> <A NAME="tex2html9274" HREF="page603.html#SECTION0018330000000000000000" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page603.html#SECTION0018330000000000000000">Accessors and Mutators</A>
</UL>
<HR><A NAME="tex2html9268" HREF="page597.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page597.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="next_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/next_motif.gif"></A> <A NAME="tex2html9266" HREF="javascript:if(confirm('http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page586.html  \n\nThis file was not retrieved by Teleport Pro, because the server reports that an error occurred that prevented retrieval.  \n\nDo you want to open it from the server?'))window.location='http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page586.html'" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page586.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="up_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/up_motif.gif"></A> <A NAME="tex2html9260" HREF="page595.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page595.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/previous_motif.gif"></A> <A NAME="tex2html9270" HREF="page9.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page9.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/contents_motif.gif"></A> <A NAME="tex2html9271" HREF="page620.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page620.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="index_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/index_motif.gif"></A> <P><ADDRESS>
<img src="bruno.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/bruno.gif" alt="Bruno" align=right>
<a href="javascript:if(confirm('http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/copyright.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/copyright.html'" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/copyright.html">Copyright &#169; 1997</a> by <a href="javascript:if(confirm('http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/signature.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/signature.html'" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/signature.html">Bruno R. Preiss, P.Eng.</a>  All rights reserved.

</ADDRESS>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?