摘要: 1packagesort;23/***//***/4/***//**5*@author6*@version1.07*/8publicclassQuickSort9{10@SuppressWarnings("unchecked")11publicstaticvoidsort(Comparable[]array)12{13sort(array,0,array.length-1);14}1516@SuppressWarnings("unchecked")17privatestaticvoidsort(Comparable[]array,intbegin,int 阅读全文
posted @ 2007-09-22 00:35 N/A2011 阅读(270) 评论(0) 推荐(0) 编辑
摘要: Deducer class: 1array=array(); 8 for($row=0;$rowarray[$row][$column]=$array[$row][$column]; 13 } 14 } 15 } 16 private function isFinished() 17 { 18 ... 阅读全文
posted @ 2007-08-29 09:35 N/A2011 阅读(247) 评论(0) 推荐(0) 编辑
摘要: Deducer class: 1using System; 2using System.Data; 3using System.Configuration; 4using System.Web; 5using System.Web.Security; 6using System.Web.UI; 7using System.Web.UI.WebControls; 8u... 阅读全文
posted @ 2007-08-29 09:30 N/A2011 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Deducer class:1packagepuzzle;23/***//**4*@author5*@version1.06*/7publicclassDeducer8{9privateint[][]array;1011publicDeducer(int[][]array)12{13this.array=newint[9][9];14for(introw=0;row<9;row++)15{16for(intcolumn=0;column<9;column++)17{18this.array[row][column]=array[row][column];19}20}21}2223p 阅读全文
posted @ 2007-08-29 09:19 N/A2011 阅读(363) 评论(0) 推荐(0) 编辑
摘要: Fraction 类: 1package joey; 2 3public class Fraction 4{ 5 private int numerator; 6 private int denominator; 7 8 public Fraction(int numerator, int denominator) throws Excep... 阅读全文
posted @ 2007-08-29 09:12 N/A2011 阅读(1433) 评论(0) 推荐(0) 编辑
摘要: 1packagenetworking;23importjava.io.*;45/***//**6*Classthatwillsendthesendfilerequest7*@author8*@version1.09*/10publicclassRequestFrameimplementsSerializable11{12/***//**13*Attributes14*/15privatestaticfinallongserialVersionUID=1L;16privateStringsender;17privateStringreceiver;18privatelongsenderKey;1 阅读全文
posted @ 2007-08-10 10:37 N/A2011 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 1packagenetworking;23importjava.io.*;45/***//**6*@author7*@version1.08*/9publicclassFileFrameimplementsSerializable10{11/***//**12*Attributes13*/14privatestaticfinallongserialVersionUID=1L;15privatedoublearrayLength;16privatedoublevalidBytes;17privatedoublesectionNumber;18privatebyte[]bytes;19privat 阅读全文
posted @ 2007-08-10 10:29 N/A2011 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 1packagenetworking;23importjava.awt.*;4importjava.io.*;5importjava.net.*;6importjava.util.*;7importjavax.swing.*;8importjavax.swing.text.*;910/***//**11*clientthreadthatwilllistenttheresponsesfromtheserver,andupdatethe12*informationtotheguiclass13*14*@author15*@version1.016*/17publicclassClientThrea 阅读全文
posted @ 2007-08-10 10:25 N/A2011 阅读(287) 评论(0) 推荐(0) 编辑
摘要: 1packagenetworking;23importjava.io.*;45/***//**6*Classthatwillcontaininformationabouttheacknowledgementaboutsendingfile7*@author8*@version1.09*/10publicclassAcknowledgementFrameimplementsSerializable11{12/***//**13*Attributes14*/15privatestaticfinallongserialVersionUID=1L;16privateStringsender;17pri 阅读全文
posted @ 2007-08-10 10:07 N/A2011 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 有几个需要注意的地方,一个是多线程的部分,然后获得inputstream和outputstream的顺序也很重要,其次ObjectOutputStream在发送的时候要记得调用reset()方法去清cache,否则不会传最新的。caller class:1packagenetworking;23importjava.io.*;4importjava.net.*;5importjava.util.*;67/***//**8*ThisclassimplementsObserver,whichwillsendtheupdatedusers'listback9*totheuser10*11*@ 阅读全文
posted @ 2007-07-30 04:16 N/A2011 阅读(370) 评论(0) 推荐(0) 编辑
摘要: linked list和arraylist各有所长,arraylist适用于很多调用get方法的场合,不适用于很多insert等改变list的size的场合,因为当数据插入到arraylist的时候实际上系统会新分配一段内存给一个新的list,然后把原来的list的内容和新插入的内容一起放到新建的list里面,这样当数据很大的时候,是很耗费系统资源的,性能也差。linked list正好相反,由于linked list的链接是通过内存指针指向相邻的node的方式联系起来的,通过这种方式,insert和add变得非常得容易,然而linked list的不足之处也很明显,由于node彼此之间的联系 阅读全文
posted @ 2007-07-03 04:11 N/A2011 阅读(300) 评论(0) 推荐(0) 编辑
摘要: 最近学习了justin的观察者模式, 感觉似乎了解了.net的event模型和java的interface模型的区别。个人理解的是,.net的event模型是针对方法的接口(定义了其他类的方法如果需要被该类的事件触发的话那些方法必须满足的规则),java的是针对类的接口(定义了其他类的方法如果需要该类的方法被触发的话那些类必须满足的规则)。下面的例子能显示这两种的区别:java的:1packageevent;23/***//**4*Buttonclass5*6*@author7*@version1.08*/9publicclassButton10{11/***//**12*IButtonint 阅读全文
posted @ 2007-07-01 01:41 N/A2011 阅读(587) 评论(0) 推荐(0) 编辑