随笔分类 -  java

java随笔
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--importjava.net.MalformedURLException;importjava.net.URISyntaxException;importcom.sun.star.beans.*;im... 阅读全文
posted @ 2009-12-03 00:37 N/A2011
摘要:build.xml [代码] 阅读全文
posted @ 2009-10-23 05:33 N/A2011
摘要:VB.NET[代码][代码]JAVA[代码][代码][代码] 阅读全文
posted @ 2009-10-17 04:24 N/A2011
摘要:[代码][代码][代码][代码] 阅读全文
posted @ 2008-09-24 08:52 N/A2011
摘要:CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/***@author*@date2008.9.13*@version1.0*/importjava.io.*;/***Classthathascommonlyusedfunctions**@author**/publicclassUtility{/***Staticmethodtowriteafile**@paramfilePath*@paramfileContent*@throwsE 阅读全文
posted @ 2008-09-23 12:47 N/A2011
摘要:1packageio;23importjava.io.*;45/***//**6*@author7*@version1.08*/9publicclassReadLineFromFile10{11/***//**12*Attributes13*/14privateBufferedReaderbr;15privateStringfilePath;1617/***//**18*Constructor19*/20publicReadLineFromFile()21{22}2324/***//**25*Constructor26*/27publicReadLineFromFile(StringfileP 阅读全文
posted @ 2007-12-03 06:43 N/A2011
摘要:1packagebTree;23importjava.io.Serializable;4importjava.util.Iterator;56/***//**7*Interfaceforabtree8*9*@author10*@version1.011*/12publicinterfaceIBTreeextendsSerializable13{14/***//**15*Methodthatwilladdannodeintothebtree16*17*@paramonodetoadd18*/19@SuppressWarnings("unchecked")20publicvoi 阅读全文
posted @ 2007-12-03 06:41 N/A2011
摘要:1/***//**2*ADTbinarysearchtree3*/4packagebinarySearchTree;56importjava.io.Serializable;7importjava.util.Iterator;89/***//**10*@author11*@version1.012*/13publicinterfaceIBinarySearchTreeextendsSerializable14{15/***//**16*Getthesizeofbinarysearchtree17*18*@returnanintofbinarysearchtree'ssize19*/20 阅读全文
posted @ 2007-12-03 06:39 N/A2011
摘要:1packagestack;23/***//**4*Thisisstackinterface5*6*@author7*@version1.08*/9publicinterfaceIStack10{11/***//**12*Methodthatwillreturnthelastelementinthestack,ifthereisno13*elementleft,itwillreturnnull14*15*@returnobject,thelastelementinthestack16*/17publicObjectpeek();1819/***//**20*Methodthatwillretu 阅读全文
posted @ 2007-12-03 06:38 N/A2011
摘要:1packagequeue;23/***//**4*Thisisqueueinterface5*6*@author7*@version1.08*/9publicinterfaceIQueue10{11/***//**12*Methodthatwillpushtheelementspecifiedbytheparameterintothe13*queue14*15*@paramobject,theelementthatwillbepushintothequeue16*/17publicvoidenQueue(Objectobject);1819/***//**20*Methodthatwillr 阅读全文
posted @ 2007-12-03 06:37 N/A2011
摘要:1packagelist;23importjava.io.*;4importjava.util.*;56/***//**7*<p>8*The<code>List</code>interfaceisdesignedtobeusedasabasisforall9*theLinearADT'sthatwillbedevelopedintheCMPP307classatSAIT.The10*implementorsofthisinterfacewillberequiredtoaddallthefunctionality,11*therewillbeno< 阅读全文
posted @ 2007-12-03 06:35 N/A2011
摘要: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
摘要:有几个需要注意的地方,一个是多线程的部分,然后获得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
摘要: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