摘要: importjava.util.*;publicclassTest...{publicstaticvoidmain(String[]args)...{//生成[0-n)个不重复的随机数//list用来保存这些随机数ArrayListlist=newArrayList();intn=10;Randomrand=newRandom();boolean[]bool=newboolean[n];intnum=0;for(inti=0;i<n;i++)...{do...{//如果产生的数相同继续循环num=rand.nextInt(n);}while(bool[num]);bool[num]=tr 阅读全文
posted @ 2008-05-16 09:33 shine_panda 阅读(1051) 评论(0) 推荐(0) 编辑
摘要: 学习spring 之前java中的几个模式是很重要的 其中一个就是代理模式。下面用几个简单的例子来理解一下这个模式。以及它的应用。1,普通的代理模式。classHouse...{privatefloatprice=200f;publicfloatgetPrice()...{returnprice;}publicvoidsetPrice()...{this.price=price;}}//房东classHouseOwner...{Househouse=null;HouseOwner(Househouse)...{this.house=house;}publicvoidrent()...{Syst 阅读全文
posted @ 2008-05-16 06:14 shine_panda 阅读(164) 评论(0) 推荐(0) 编辑