⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 product.html

📁 卡耐基课程练习
💻 HTML
字号:

<hr>
<!-- ======== START OF CLASS DATA ======== -->

<h2>
Class Product</h2>
<pre><a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</a>
  <img src="/content/SSD/SSD3/4.2.0.1/normal/pg-class-dsgn/pg-java-apps/assm-exer-read-obj-data/pool-pr-apps-io-tokenzr-excptns/qn-pr-shopping-cart/handout/resources/inherit.gif" alt="extended by "><b>Product</b>
</pre>
<hr>
<dl>
<dt><pre>public class <b>Product</b><dt>extends <a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</a></dt></pre></dt></dl>

<p>
Stores the following product information:
 </p><ol>
 <li>the name of the product, a <code>String</code></li>
 <li>the quantity of the product, an <code>int</code></li>
 <li>the price of the product, a <code>double</code> </li>

 </ol>
<p>

</p><p>
</p><dl>
<dt><b>Version:</b></dt>
  <dd>1.0.0</dd>
<dt><b>Author:</b></dt>
  <dd>iCarnegie</dd>
</dl>

<hr>

<p>

<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<a name="constructor_summary"><!-- --></a>
</p><table summary="" border="1" cellpadding="3" cellspacing="0" width="100%">
<tbody><tr class="TableHeadingColor" bgcolor="#ccccff">
<th colspan="2" align="left"><font size="+2">
<b>Constructor Summary</b></font></th>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td><code><b><a href="/content/SSD/SSD3/4.2.0.1/normal/pg-class-dsgn/pg-java-apps/assm-exer-read-obj-data/pool-pr-apps-io-tokenzr-excptns/qn-pr-shopping-cart/handout/Product.html#Product%28java.lang.String,%20int,%20double%29">Product</a></b>(<a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang" target="external">String</a>&nbsp;initialName,
        int&nbsp;initialQuantity,
        double&nbsp;initialPrice)</code>

<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a <code>Product</code> object.</td>
</tr>
</tbody></table>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<a name="method_summary"><!-- --></a>
<table summary="" border="1" cellpadding="3" cellspacing="0" width="100%">
<tbody><tr class="TableHeadingColor" bgcolor="#ccccff">
<th colspan="2" align="left"><font size="+2">
<b>Method Summary</b></font></th>

</tr>
<tr class="TableRowColor" bgcolor="white">
<td align="right" valign="top" width="1%"><font size="-1">
<code>&nbsp;<a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang" target="external">String</a></code></font></td>
<td><code><b><a href="/content/SSD/SSD3/4.2.0.1/normal/pg-class-dsgn/pg-java-apps/assm-exer-read-obj-data/pool-pr-apps-io-tokenzr-excptns/qn-pr-shopping-cart/handout/Product.html#getName%28%29">getName</a></b>()</code>

<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Obtains the name of this product.</td>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td align="right" valign="top" width="1%"><font size="-1">
<code>&nbsp;double</code></font></td>

<td><code><b><a href="/content/SSD/SSD3/4.2.0.1/normal/pg-class-dsgn/pg-java-apps/assm-exer-read-obj-data/pool-pr-apps-io-tokenzr-excptns/qn-pr-shopping-cart/handout/Product.html#getPrice%28%29">getPrice</a></b>()</code>

<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Obtains the price of this product.</td>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td align="right" valign="top" width="1%"><font size="-1">
<code>&nbsp;int</code></font></td>
<td><code><b><a href="/content/SSD/SSD3/4.2.0.1/normal/pg-class-dsgn/pg-java-apps/assm-exer-read-obj-data/pool-pr-apps-io-tokenzr-excptns/qn-pr-shopping-cart/handout/Product.html#getQuantity%28%29">getQuantity</a></b>()</code>

<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Obtains the quantity of this product.</td>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td align="right" valign="top" width="1%"><font size="-1">
<code>&nbsp;double</code></font></td>
<td><code><b><a href="/content/SSD/SSD3/4.2.0.1/normal/pg-class-dsgn/pg-java-apps/assm-exer-read-obj-data/pool-pr-apps-io-tokenzr-excptns/qn-pr-shopping-cart/handout/Product.html#getValue%28%29">getValue</a></b>()</code>

<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Obtains the value of this product.</td>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td align="right" valign="top" width="1%"><font size="-1">

<code>&nbsp;<a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang" target="external">String</a></code></font></td>
<td><code><b><a href="/content/SSD/SSD3/4.2.0.1/normal/pg-class-dsgn/pg-java-apps/assm-exer-read-obj-data/pool-pr-apps-io-tokenzr-excptns/qn-pr-shopping-cart/handout/Product.html#toString%28%29">toString</a></b>()</code>

<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <code>String</code> representation of this product.</td>
</tr>
</tbody></table>
&nbsp;<a name="methods_inherited_from_class_java.lang.Object"><!-- --></a>
<table summary="" border="1" cellpadding="3" cellspacing="0" width="100%">
<tbody><tr class="TableSubHeadingColor" bgcolor="#eeeeff">

<th align="left"><b>Methods inherited from class java.lang.<a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang" target="external">Object</a></b></th>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td><code><a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#clone%28%29" title="class or interface in java.lang" target="external">clone</a>, <a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#equals%28java.lang.Object%29" title="class or interface in java.lang" target="external">equals</a>, <a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#finalize%28%29" title="class or interface in java.lang" target="external">finalize</a>, <a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#getClass%28%29" title="class or interface in java.lang" target="external">getClass</a>, <a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#hashCode%28%29" title="class or interface in java.lang" target="external">hashCode</a>, <a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#notify%28%29" title="class or interface in java.lang" target="external">notify</a>, <a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#notifyAll%28%29" title="class or interface in java.lang" target="external">notifyAll</a>, <a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#wait%28%29" title="class or interface in java.lang" target="external">wait</a>, <a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#wait%28long%29" title="class or interface in java.lang" target="external">wait</a>, <a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#wait%28long,%20int%29" title="class or interface in java.lang" target="external">wait</a></code></td>

</tr>
</tbody></table>
&nbsp;
<p>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<a name="constructor_detail"><!-- --></a>
</p><table summary="" border="1" cellpadding="3" cellspacing="0" width="100%">
<tbody><tr class="TableHeadingColor" bgcolor="#ccccff">
<th colspan="1" align="left"><font size="+2">
<b>Constructor Detail</b></font></th>
</tr>
</tbody></table>

<a name="Product(java.lang.String, int, double)"><!-- --></a><h3>

Product</h3>
<pre>public <b>Product</b>(<a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</a>&nbsp;initialName,
               int&nbsp;initialQuantity,
               double&nbsp;initialPrice)</pre>
<dl>
<dd>Constructs a <code>Product</code> object.
<p>
</p><dl>

<dt><b>Parameters:</b></dt><dd><code>initialName</code> - the name of the product.</dd><dd><code>initialQuantity</code> - the quantity of the product.</dd><dd><code>initialPrice</code> - the price of the product.</dd></dl>
</dd></dl>

<!-- ============ METHOD DETAIL ========== -->

<a name="method_detail"><!-- --></a>
<table summary="" border="1" cellpadding="3" cellspacing="0" width="100%">

<tbody><tr class="TableHeadingColor" bgcolor="#ccccff">
<th colspan="1" align="left"><font size="+2">
<b>Method Detail</b></font></th>
</tr>
</tbody></table>

<a name="getName()"><!-- --></a><h3>
getName</h3>
<pre>public <a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</a> <b>getName</b>()</pre>
<dl>

<dd>Obtains the name of this product.
<p>
</p></dd><dd><dl>

<dt><b>Returns:</b></dt><dd>the name of this product.</dd></dl>
</dd>
</dl>
<hr>

<a name="getQuantity()"><!-- --></a><h3>
getQuantity</h3>
<pre>public int <b>getQuantity</b>()</pre>

<dl>
<dd>Obtains the quantity of this product.
<p>
</p></dd><dd><dl>

<dt><b>Returns:</b></dt><dd>the quantity of this product.</dd></dl>
</dd>
</dl>
<hr>

<a name="getPrice()"><!-- --></a><h3>
getPrice</h3>
<pre>public double <b>getPrice</b>()</pre>

<dl>
<dd>Obtains the price of this product.
<p>
</p></dd><dd><dl>

<dt><b>Returns:</b></dt><dd>price of this product.</dd></dl>
</dd>
</dl>
<hr>

<a name="toString()"><!-- --></a><h3>
toString</h3>
<pre>public <a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</a> <b>toString</b>()</pre>

<dl>
<dd>Returns a <code>String</code> representation of this product.
<p>
</p></dd><dd><dl>
<dt><b>Overrides:</b></dt><dd><code><a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#toString%28%29" title="class or interface in java.lang" target="external">toString</a></code> in class <code><a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang" target="external">Object</a></code></dd></dl>
</dd>
<dd><dl>

<dt><b>Returns:</b></dt><dd>a string representation of this product.</dd></dl>

</dd>
</dl>
<hr>

<a name="getValue()"><!-- --></a><h3>
getValue</h3>
<pre>public double <b>getValue</b>()</pre>
<dl>
<dd>Obtains the value of this product.
 <p>
 The value is quantity times price.
 </p>

<p>
</p></dd><dd><dl>

<dt><b>Returns:</b></dt><dd>the value of this product.</dd></dl>
</dd>
</dl>
<!-- ========= END OF CLASS DATA ========= -->
<hr>

<hr>

⌨️ 快捷键说明

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