﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-第二小组</title><link>http://www.blogjava.net/the2rdTeam/</link><description /><language>zh-cn</language><lastBuildDate>Thu, 30 Apr 2026 02:42:25 GMT</lastBuildDate><pubDate>Thu, 30 Apr 2026 02:42:25 GMT</pubDate><ttl>60</ttl><item><title>Java 5.0新特性 - 枚举类型enum</title><link>http://www.blogjava.net/the2rdTeam/archive/2005/07/29/8685.html</link><dc:creator>第二小组</dc:creator><author>第二小组</author><pubDate>Thu, 28 Jul 2005 16:20:00 GMT</pubDate><guid>http://www.blogjava.net/the2rdTeam/archive/2005/07/29/8685.html</guid><wfw:comment>http://www.blogjava.net/the2rdTeam/comments/8685.html</wfw:comment><comments>http://www.blogjava.net/the2rdTeam/archive/2005/07/29/8685.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.blogjava.net/the2rdTeam/comments/commentRss/8685.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/the2rdTeam/services/trackbacks/8685.html</trackback:ping><description><![CDATA[<P><FONT face=Verdana size=2>Java 语言的两个基本的元素是类(class)和接口(interface),现在Tiger又引入了枚举(enum).<BR>其实枚举也不能算是严格意义上的新元素,它也是一种类,是一种特殊的类.所有的枚举都默认继承自java.lang.Enum,如果所有的类都默认继承自java.lang.Object一样.在Java提供的枚举中提供了比C/C++更多的功能,在这里可以像一般的类一样定义方法和属性,也可以有受限的构造函数(只能是private,且默认如此).</FONT></P>
<P><FONT face=Verdana size=2>下面试写了一个枚举,以供参考.<BR><BR></FONT></P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><FONT face=Verdana size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">package&nbsp;kb.enums;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG id=Codehighlighter1_43_505_Open_Image onclick="this.style.display='none'; Codehighlighter1_43_505_Open_Text.style.display='none'; Codehighlighter1_43_505_Closed_Image.style.display='inline'; Codehighlighter1_43_505_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_43_505_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_43_505_Closed_Text.style.display='none'; Codehighlighter1_43_505_Open_Image.style.display='inline'; Codehighlighter1_43_505_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">enum</SPAN><SPAN style="COLOR: #000000">&nbsp;Temperature&nbsp;</SPAN><SPAN id=Codehighlighter1_43_505_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN></FONT></FONT><SPAN id=Codehighlighter1_43_505_Open_Text><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;VeryHigh(</SPAN><SPAN style="COLOR: #000000">100.0</SPAN><SPAN style="COLOR: #000000">),&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">!这样使用构造函数</SPAN></FONT></FONT><SPAN style="COLOR: #008000"><BR><FONT face=Verdana size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top></FONT></SPAN><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;High,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;LessComfortable,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;Comfortable(</SPAN><SPAN style="COLOR: #000000">25.0</SPAN><SPAN style="COLOR: #000000">),&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">构造函数</SPAN></FONT></FONT><SPAN style="COLOR: #008000"><BR><FONT face=Verdana size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top></FONT></SPAN><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;MoreComfortable,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;Low,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;VeryLow(</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">15.0</SPAN><SPAN style="COLOR: #000000">);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">构造函数</SPAN></FONT></FONT><SPAN style="COLOR: #008000"><BR><FONT face=Verdana size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top></FONT></SPAN><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">double</SPAN></FONT></FONT><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">&nbsp;degree;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG id=Codehighlighter1_229_256_Open_Image onclick="this.style.display='none'; Codehighlighter1_229_256_Open_Text.style.display='none'; Codehighlighter1_229_256_Closed_Image.style.display='inline'; Codehighlighter1_229_256_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_229_256_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_229_256_Closed_Text.style.display='none'; Codehighlighter1_229_256_Open_Image.style.display='inline'; Codehighlighter1_229_256_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;Temperature(&nbsp;</SPAN><SPAN style="COLOR: #0000ff">double</SPAN><SPAN style="COLOR: #000000">&nbsp;d&nbsp;)&nbsp;</SPAN><SPAN id=Codehighlighter1_229_256_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN></FONT></FONT><SPAN id=Codehighlighter1_229_256_Open_Text><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">private</SPAN></FONT></FONT><SPAN style="COLOR: #008000"><BR><FONT face=Verdana size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top></FONT></SPAN><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;degree&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT></FONT><SPAN style="COLOR: #000000"><FONT face=Verdana size=2>&nbsp;d;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT face=Verdana size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG id=Codehighlighter1_275_295_Open_Image onclick="this.style.display='none'; Codehighlighter1_275_295_Open_Text.style.display='none'; Codehighlighter1_275_295_Closed_Image.style.display='inline'; Codehighlighter1_275_295_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_275_295_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_275_295_Closed_Text.style.display='none'; Codehighlighter1_275_295_Open_Image.style.display='inline'; Codehighlighter1_275_295_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;Temperature()&nbsp;</FONT></SPAN><SPAN id=Codehighlighter1_275_295_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><FONT face=Verdana size=2><IMG src="http://www.blogjava.net/images/dot.gif"></FONT></SPAN><SPAN id=Codehighlighter1_275_295_Open_Text><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;degree&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">1.0</SPAN></FONT></FONT><SPAN style="COLOR: #000000"><FONT face=Verdana size=2>;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT face=Verdana size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG id=Codehighlighter1_337_503_Open_Image onclick="this.style.display='none'; Codehighlighter1_337_503_Open_Text.style.display='none'; Codehighlighter1_337_503_Closed_Image.style.display='inline'; Codehighlighter1_337_503_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_337_503_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_337_503_Closed_Text.style.display='none'; Codehighlighter1_337_503_Open_Image.style.display='inline'; Codehighlighter1_337_503_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;String&nbsp;getMemberList()&nbsp;</SPAN><SPAN id=Codehighlighter1_337_503_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN></FONT></FONT><SPAN id=Codehighlighter1_337_503_Open_Text><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StringBuffer&nbsp;buf&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN></FONT></FONT><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">&nbsp;StringBuffer();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG id=Codehighlighter1_429_472_Open_Image onclick="this.style.display='none'; Codehighlighter1_429_472_Open_Text.style.display='none'; Codehighlighter1_429_472_Closed_Image.style.display='inline'; Codehighlighter1_429_472_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_429_472_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_429_472_Closed_Text.style.display='none'; Codehighlighter1_429_472_Open_Image.style.display='inline'; Codehighlighter1_429_472_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(&nbsp;Temperature&nbsp;t&nbsp;:&nbsp;Temperature.values()&nbsp;)&nbsp;</SPAN><SPAN id=Codehighlighter1_429_472_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN></FONT></FONT><SPAN id=Codehighlighter1_429_472_Open_Text><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buf.append(&nbsp;t.toString()&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">\n</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT></FONT><SPAN style="COLOR: #000000"><FONT face=Verdana size=2>&nbsp;);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT face=Verdana size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><SPAN style="COLOR: #0000ff"><FONT face=Verdana size=2>return</FONT></SPAN><SPAN style="COLOR: #000000"><FONT face=Verdana size=2>&nbsp;buf.toString();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT face=Verdana size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT face=Verdana size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN></DIV></DIV><BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><FONT face=Verdana size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">package&nbsp;kb.enums;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG id=Codehighlighter1_47_462_Open_Image onclick="this.style.display='none'; Codehighlighter1_47_462_Open_Text.style.display='none'; Codehighlighter1_47_462_Closed_Image.style.display='inline'; Codehighlighter1_47_462_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_47_462_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_47_462_Closed_Text.style.display='none'; Codehighlighter1_47_462_Open_Image.style.display='inline'; Codehighlighter1_47_462_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;UseTemperature&nbsp;</SPAN><SPAN id=Codehighlighter1_47_462_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN></FONT></FONT><SPAN id=Codehighlighter1_47_462_Open_Text><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;StringBuffer&nbsp;</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN></FONT></FONT><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">&nbsp;StringBuffer();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG id=Codehighlighter1_148_459_Open_Image onclick="this.style.display='none'; Codehighlighter1_148_459_Open_Text.style.display='none'; Codehighlighter1_148_459_Closed_Image.style.display='inline'; Codehighlighter1_148_459_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_148_459_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_148_459_Closed_Text.style.display='none'; Codehighlighter1_148_459_Open_Image.style.display='inline'; Codehighlighter1_148_459_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;main(String[]&nbsp;args)&nbsp;</SPAN><SPAN id=Codehighlighter1_148_459_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN></FONT></FONT><SPAN id=Codehighlighter1_148_459_Open_Text><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Temperature&nbsp;temp&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT></FONT><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">&nbsp;Temperature.High;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">switch</SPAN></FONT></FONT><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">(&nbsp;temp&nbsp;)<BR><IMG id=Codehighlighter1_214_367_Open_Image onclick="this.style.display='none'; Codehighlighter1_214_367_Open_Text.style.display='none'; Codehighlighter1_214_367_Closed_Image.style.display='inline'; Codehighlighter1_214_367_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_214_367_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_214_367_Closed_Text.style.display='none'; Codehighlighter1_214_367_Open_Image.style.display='inline'; Codehighlighter1_214_367_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_214_367_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN></FONT></FONT><SPAN id=Codehighlighter1_214_367_Open_Text><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">case</SPAN></FONT></FONT><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">&nbsp;Comfortable:<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">.append(&nbsp;Temperature.Comfortable.toString()&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">\n</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT></FONT><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">&nbsp;);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">break</SPAN></FONT></FONT><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">default</SPAN></FONT></FONT><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">:<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">.append(&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Uncomfortable\n</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT></FONT><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">&nbsp;);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">break</SPAN></FONT></FONT><SPAN style="COLOR: #000000"><FONT face=Verdana size=2>;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT face=Verdana size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><SPAN style="COLOR: #0000ff"><FONT face=Verdana size=2>out</FONT></SPAN><FONT face=Verdana><FONT size=2><SPAN style="COLOR: #000000">.append(&nbsp;Temperature.getMemberList()&nbsp;);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">.print(&nbsp;</SPAN><SPAN style="COLOR: #0000ff">out</SPAN></FONT></FONT><SPAN style="COLOR: #000000"><FONT face=Verdana size=2>.toString()&nbsp;);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT face=Verdana size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT face=Verdana size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT></SPAN></DIV></DIV><img src ="http://www.blogjava.net/the2rdTeam/aggbug/8685.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/the2rdTeam/" target="_blank">第二小组</a> 2005-07-29 00:20 <a href="http://www.blogjava.net/the2rdTeam/archive/2005/07/29/8685.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>复数类实现 by freeyun</title><link>http://www.blogjava.net/the2rdTeam/archive/2005/07/29/8684.html</link><dc:creator>第二小组</dc:creator><author>第二小组</author><pubDate>Thu, 28 Jul 2005 16:16:00 GMT</pubDate><guid>http://www.blogjava.net/the2rdTeam/archive/2005/07/29/8684.html</guid><wfw:comment>http://www.blogjava.net/the2rdTeam/comments/8684.html</wfw:comment><comments>http://www.blogjava.net/the2rdTeam/archive/2005/07/29/8684.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/the2rdTeam/comments/commentRss/8684.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/the2rdTeam/services/trackbacks/8684.html</trackback:ping><description><![CDATA[<P>&nbsp;</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;complex<BR><IMG id=Codehighlighter1_15_1065_Open_Image onclick="this.style.display='none'; Codehighlighter1_15_1065_Open_Text.style.display='none'; Codehighlighter1_15_1065_Closed_Image.style.display='inline'; Codehighlighter1_15_1065_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_15_1065_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_15_1065_Closed_Text.style.display='none'; Codehighlighter1_15_1065_Open_Image.style.display='inline'; Codehighlighter1_15_1065_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_15_1065_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_15_1065_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">double</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;real,imag;<BR><IMG id=Codehighlighter1_62_63_Open_Image onclick="this.style.display='none'; Codehighlighter1_62_63_Open_Text.style.display='none'; Codehighlighter1_62_63_Closed_Image.style.display='inline'; Codehighlighter1_62_63_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_62_63_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_62_63_Closed_Text.style.display='none'; Codehighlighter1_62_63_Open_Image.style.display='inline'; Codehighlighter1_62_63_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;complex&nbsp;()&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_62_63_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_62_63_Open_Text><SPAN style="COLOR: #000000">{}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;complex(</SPAN><SPAN style="COLOR: #0000ff">double</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;r,</SPAN><SPAN style="COLOR: #0000ff">double</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;i)<BR><IMG id=Codehighlighter1_111_157_Open_Image onclick="this.style.display='none'; Codehighlighter1_111_157_Open_Text.style.display='none'; Codehighlighter1_111_157_Closed_Image.style.display='inline'; Codehighlighter1_111_157_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_111_157_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_111_157_Closed_Text.style.display='none'; Codehighlighter1_111_157_Open_Image.style.display='inline'; Codehighlighter1_111_157_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_111_157_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_111_157_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;real</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">r;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;imag</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">i;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000">&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;complex&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;addition(complex&nbsp;x,complex&nbsp;&nbsp;&nbsp;y)<BR><IMG id=Codehighlighter1_221_332_Open_Image onclick="this.style.display='none'; Codehighlighter1_221_332_Open_Text.style.display='none'; Codehighlighter1_221_332_Closed_Image.style.display='inline'; Codehighlighter1_221_332_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_221_332_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_221_332_Closed_Text.style.display='none'; Codehighlighter1_221_332_Open_Image.style.display='inline'; Codehighlighter1_221_332_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_221_332_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_221_332_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.real</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">x.real</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">y.real;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.imag</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">x.imag</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">y.imag;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">)&nbsp;;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;complex&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;subtraction(complex&nbsp;x,complex&nbsp;&nbsp;&nbsp;y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG id=Codehighlighter1_405_529_Open_Image onclick="this.style.display='none'; Codehighlighter1_405_529_Open_Text.style.display='none'; Codehighlighter1_405_529_Closed_Image.style.display='inline'; Codehighlighter1_405_529_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_405_529_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_405_529_Closed_Text.style.display='none'; Codehighlighter1_405_529_Open_Image.style.display='inline'; Codehighlighter1_405_529_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_405_529_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_405_529_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.real</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">x.real</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">y.real;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.imag</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">x.imag</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">y.imag;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">)&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;complex&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;multiplication(complex&nbsp;x,complex&nbsp;&nbsp;&nbsp;y)<BR><IMG id=Codehighlighter1_597_765_Open_Image onclick="this.style.display='none'; Codehighlighter1_597_765_Open_Text.style.display='none'; Codehighlighter1_597_765_Closed_Image.style.display='inline'; Codehighlighter1_597_765_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_597_765_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_597_765_Closed_Text.style.display='none'; Codehighlighter1_597_765_Open_Image.style.display='inline'; Codehighlighter1_597_765_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_597_765_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_597_765_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.real</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">(x.real)</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">(y.real)</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">(x.imag)</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">(y.imag);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.imag</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">(x.real)</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">(y.imag)</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">(x.imag)</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">(y.real);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">)&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;complex&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;division(complex&nbsp;x,complex&nbsp;&nbsp;&nbsp;y)<BR><IMG id=Codehighlighter1_828_1062_Open_Image onclick="this.style.display='none'; Codehighlighter1_828_1062_Open_Text.style.display='none'; Codehighlighter1_828_1062_Closed_Image.style.display='inline'; Codehighlighter1_828_1062_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_828_1062_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_828_1062_Closed_Text.style.display='none'; Codehighlighter1_828_1062_Open_Image.style.display='inline'; Codehighlighter1_828_1062_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_828_1062_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_828_1062_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.real</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">((x.real)</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">(y.real)</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">(x.imag)</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">(y.imag))</SPAN><SPAN style="COLOR: #000000">/</SPAN><SPAN style="COLOR: #000000">((y.real)</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">(y.real)</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">(y.imag)</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">(y.imag));<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.imag</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">((x.imag)</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">(y.real)</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">(x.real)</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">(y.imag))</SPAN><SPAN style="COLOR: #000000">/</SPAN><SPAN style="COLOR: #000000">((y.real)</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">(y.real)</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">(y.imag)</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">(y.imag));<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">)&nbsp;;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;C<BR><IMG id=Codehighlighter1_1103_1700_Open_Image onclick="this.style.display='none'; Codehighlighter1_1103_1700_Open_Text.style.display='none'; Codehighlighter1_1103_1700_Closed_Image.style.display='inline'; Codehighlighter1_1103_1700_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_1103_1700_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1103_1700_Closed_Text.style.display='none'; Codehighlighter1_1103_1700_Open_Image.style.display='inline'; Codehighlighter1_1103_1700_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_1103_1700_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1103_1700_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;main(String&nbsp;&nbsp;&nbsp;&nbsp;args[])<BR><IMG id=Codehighlighter1_1161_1698_Open_Image onclick="this.style.display='none'; Codehighlighter1_1161_1698_Open_Text.style.display='none'; Codehighlighter1_1161_1698_Closed_Image.style.display='inline'; Codehighlighter1_1161_1698_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1161_1698_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1161_1698_Closed_Text.style.display='none'; Codehighlighter1_1161_1698_Open_Image.style.display='inline'; Codehighlighter1_1161_1698_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1161_1698_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1161_1698_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;complex&nbsp;&nbsp;&nbsp;c1</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;complex(</SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">4</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;complex&nbsp;&nbsp;&nbsp;c2</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;complex(</SPAN><SPAN style="COLOR: #000000">4</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">8</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;complex&nbsp;&nbsp;&nbsp;c</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;complex();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c.addition(c1,c2);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">.println(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">c=c1(2,4)+c2(4,8)</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">c.real</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">c.imag);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c.subtraction(c1,c2);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">.println(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">c=c1(2,4)-c2(4,8)</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">c.real</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">c.imag);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c.multiplication(c1,c2);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">.println(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">c=c1(2,4)*c2(4,8)</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">c.real</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">c.imag);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c.division(c1,c2);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">.println(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">c=c1(2,4)/c2(4,8)</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">c.real</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">c.imag);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000">&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>
<P><BR><BR><BR><FONT color=#006400>name&nbsp;&nbsp;&nbsp;&nbsp; C.java<BR>运行结果：c=c1(2,4)+c2(4,8)&nbsp;&nbsp;&nbsp;&nbsp; 6.0 ,12.0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c=c1(2,4)-c2(4,8)&nbsp;&nbsp;&nbsp; -2.0&nbsp;,-4.0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c=c1(2,4)*c2(4,8)&nbsp;&nbsp;&nbsp;&nbsp;-24.0,32.0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c=c1(2,4)/c2(4,8)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0.5,0.0<BR></FONT><BR><FONT color=#800080><FONT color=#a52a2a>求助：</FONT>为什么我在函数中用getReal,getImag分别返回各函数的实部和虚部实现不了？</FONT></P><img src ="http://www.blogjava.net/the2rdTeam/aggbug/8684.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/the2rdTeam/" target="_blank">第二小组</a> 2005-07-29 00:16 <a href="http://www.blogjava.net/the2rdTeam/archive/2005/07/29/8684.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>复数类实现 - kb</title><link>http://www.blogjava.net/the2rdTeam/archive/2005/07/28/8681.html</link><dc:creator>第二小组</dc:creator><author>第二小组</author><pubDate>Thu, 28 Jul 2005 14:44:00 GMT</pubDate><guid>http://www.blogjava.net/the2rdTeam/archive/2005/07/28/8681.html</guid><wfw:comment>http://www.blogjava.net/the2rdTeam/comments/8681.html</wfw:comment><comments>http://www.blogjava.net/the2rdTeam/archive/2005/07/28/8681.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.blogjava.net/the2rdTeam/comments/commentRss/8681.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/the2rdTeam/services/trackbacks/8681.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 一共三个文件：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ComplexException.java&nbsp;&nbsp; ：&nbsp; Complex类所应的异常&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Complex.java &nbsp; ： Complex类...&nbsp;&nbsp;<a href='http://www.blogjava.net/the2rdTeam/archive/2005/07/28/8681.html'>阅读全文</a><img src ="http://www.blogjava.net/the2rdTeam/aggbug/8681.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/the2rdTeam/" target="_blank">第二小组</a> 2005-07-28 22:44 <a href="http://www.blogjava.net/the2rdTeam/archive/2005/07/28/8681.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>这几天进度如何啊？</title><link>http://www.blogjava.net/the2rdTeam/archive/2005/07/28/8648.html</link><dc:creator>第二小组</dc:creator><author>第二小组</author><pubDate>Thu, 28 Jul 2005 09:23:00 GMT</pubDate><guid>http://www.blogjava.net/the2rdTeam/archive/2005/07/28/8648.html</guid><wfw:comment>http://www.blogjava.net/the2rdTeam/comments/8648.html</wfw:comment><comments>http://www.blogjava.net/the2rdTeam/archive/2005/07/28/8648.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/the2rdTeam/comments/commentRss/8648.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/the2rdTeam/services/trackbacks/8648.html</trackback:ping><description><![CDATA[<P><FONT face=Verdana size=2>据我感觉好像进度很慢啊，这么久了连一篇学习日记都没有写，所以今天我提了个问题，看看谁做的好些。还有可以的话在后面<STRONG>简要地说说各位的进度</STRONG>如何，老是没反应我就觉得好像都跟我一样呢<IMG height=19 src="http://www.blogjava.net/Emoticons/75_75.gif" width=19 border=0></FONT></P><img src ="http://www.blogjava.net/the2rdTeam/aggbug/8648.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/the2rdTeam/" target="_blank">第二小组</a> 2005-07-28 17:23 <a href="http://www.blogjava.net/the2rdTeam/archive/2005/07/28/8648.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>编程练习: 自己实现复数类</title><link>http://www.blogjava.net/the2rdTeam/archive/2005/07/28/8647.html</link><dc:creator>第二小组</dc:creator><author>第二小组</author><pubDate>Thu, 28 Jul 2005 09:10:00 GMT</pubDate><guid>http://www.blogjava.net/the2rdTeam/archive/2005/07/28/8647.html</guid><wfw:comment>http://www.blogjava.net/the2rdTeam/comments/8647.html</wfw:comment><comments>http://www.blogjava.net/the2rdTeam/archive/2005/07/28/8647.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/the2rdTeam/comments/commentRss/8647.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/the2rdTeam/services/trackbacks/8647.html</trackback:ping><description><![CDATA[<FONT face=Verdana color=#006400>要求自己实现一个复数类，实现复数的各种必须操作以及其它合理的操作，并尽量保证具有易用性和可扩展性。尽量设计一个良好的类层次结构，有必要的注释等。<BR>请在7月29日早上8点钟之前将写好的代码以新随笔的形式发表（注明作者），小组之外的人可以直接跟在此文章后面，并在网站分类中选择<STRONG>首页原创Java技术区</STRONG>，以便让更多的人评价。</FONT><img src ="http://www.blogjava.net/the2rdTeam/aggbug/8647.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/the2rdTeam/" target="_blank">第二小组</a> 2005-07-28 17:10 <a href="http://www.blogjava.net/the2rdTeam/archive/2005/07/28/8647.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>电子书</title><link>http://www.blogjava.net/the2rdTeam/archive/2005/07/26/8507.html</link><dc:creator>第二小组</dc:creator><author>第二小组</author><pubDate>Tue, 26 Jul 2005 13:43:00 GMT</pubDate><guid>http://www.blogjava.net/the2rdTeam/archive/2005/07/26/8507.html</guid><wfw:comment>http://www.blogjava.net/the2rdTeam/comments/8507.html</wfw:comment><comments>http://www.blogjava.net/the2rdTeam/archive/2005/07/26/8507.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/the2rdTeam/comments/commentRss/8507.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/the2rdTeam/services/trackbacks/8507.html</trackback:ping><description><![CDATA[看电子图书看的人头晕晕的，还是书看起来比较舒服。这么快就26号了，感觉好像什么都没做。<img src ="http://www.blogjava.net/the2rdTeam/aggbug/8507.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/the2rdTeam/" target="_blank">第二小组</a> 2005-07-26 21:43 <a href="http://www.blogjava.net/the2rdTeam/archive/2005/07/26/8507.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MVC框架</title><link>http://www.blogjava.net/the2rdTeam/archive/2005/07/25/8375.html</link><dc:creator>第二小组</dc:creator><author>第二小组</author><pubDate>Sun, 24 Jul 2005 23:27:00 GMT</pubDate><guid>http://www.blogjava.net/the2rdTeam/archive/2005/07/25/8375.html</guid><wfw:comment>http://www.blogjava.net/the2rdTeam/comments/8375.html</wfw:comment><comments>http://www.blogjava.net/the2rdTeam/archive/2005/07/25/8375.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/the2rdTeam/comments/commentRss/8375.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/the2rdTeam/services/trackbacks/8375.html</trackback:ping><description><![CDATA[<FONT face=Verdana size=2>MVC是一种设计模式，用在WEB框架中，使我们有效的对WEB层进行再分层：VIEW+ACTION<BR>struts,webwork都是MVC框架，而webwork更是灵活优雅，令人赞叹！<BR>熟悉MVC和接受MVC的人也越来越多。无需多说，Jacker也拥抱MVC；<BR><BR>看来MVC确实是很不错啊，但我还没学呢;-)呵呵,以后再谈自己对MVC的感受吧。</FONT><img src ="http://www.blogjava.net/the2rdTeam/aggbug/8375.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/the2rdTeam/" target="_blank">第二小组</a> 2005-07-25 07:27 <a href="http://www.blogjava.net/the2rdTeam/archive/2005/07/25/8375.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>我们小组在这里安家了！</title><link>http://www.blogjava.net/the2rdTeam/archive/2005/07/25/8373.html</link><dc:creator>第二小组</dc:creator><author>第二小组</author><pubDate>Sun, 24 Jul 2005 22:36:00 GMT</pubDate><guid>http://www.blogjava.net/the2rdTeam/archive/2005/07/25/8373.html</guid><wfw:comment>http://www.blogjava.net/the2rdTeam/comments/8373.html</wfw:comment><comments>http://www.blogjava.net/the2rdTeam/archive/2005/07/25/8373.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/the2rdTeam/comments/commentRss/8373.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/the2rdTeam/services/trackbacks/8373.html</trackback:ping><description><![CDATA[这儿是个很不错的学习Java的事环境啊，有很多的文章可看，也有很多的人可以交流。欢迎其它小组成员以及其它该博客中有兴趣的朋友参与进我们的学习交流之中。<BR>大家在这儿要活跃一点，发表文章及问题时要有点把握，以便吸引更多的人参与进来。<img src ="http://www.blogjava.net/the2rdTeam/aggbug/8373.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/the2rdTeam/" target="_blank">第二小组</a> 2005-07-25 06:36 <a href="http://www.blogjava.net/the2rdTeam/archive/2005/07/25/8373.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>