java基础
kkooff114
这个作者很懒,什么都没留下…
展开
-
list用法
http://www.isstudy.com/java/1756.html List的用法 List包括List接口以及List接口的所有实现类。因为List接口实现了Collection接口,所以List接口拥有Collection接口提供的所有常用方法,又因为List是列表类型,所以List接口还提供了一些适合于自身的常用方法,如表1所示。 表1 List接口定义的常用方法转载 2012-05-11 16:39:21 · 242 阅读 · 0 评论 -
随机数生成方法
jsp随机数 2007-05-31 13:43 Random random=new Random(); int temp1=random.nextInt(3); //从0开始 , 3为总数 , 就是0、1、2随机 int temp2=5+random.nextInt(6); //从5开始到10之间的随机数 out.println(temp1);转载 2012-05-12 20:17:40 · 684 阅读 · 0 评论 -
jsp截取字符串
提取出来的str 如果长度大于10则取8位,后面加... 如果长度小于10则直接输出 <% int i=str.length(); if(i==10) { out.print(str); }else if(i>10){ str=str.substring(0,7); //字符串截取0-7共8位 out.print(str+"..."); }else{ out.print(原创 2012-05-13 13:58:09 · 1119 阅读 · 0 评论 -
ArrayList的用法
原文:http://blog.csdn.net/yc_8301/article/details/2230592 作者:yc_8301 1、什么是ArrayList ArrayList就是传说中的动态数组,用MSDN中的说法,就是Array的复杂版本,它提供了如下一些好处: 动态的增加和减少元素;实现了ICollection和IList接口;灵活的设置数组的大小。 2、如何使转载 2012-05-10 00:22:06 · 549 阅读 · 0 评论