2013年3月4日

Java LinkedList ArrayList

摘要: http://blog.csdn.net/yanglei031/article/details/4538869一般大家都知道ArrayList和LinkedList的大致区别: 1.ArrayList是实现了基于动态数组的数据结构,LinkedList基于链表的数据结构。 2.对于随机访问get和set,ArrayList觉得优于LinkedList,因为LinkedList要移动指针。 3.对于新增和删除操作add和remove,LinedList比较占优势,因为ArrayList要移动数据。List是一个接口,而ListArray是一个类。ListArray继承并实现了List。所以Lis 阅读全文

posted @ 2013-03-04 19:06 Sure_Yi 阅读(255) 评论(0) 推荐(0) 编辑

String 使用方法

摘要: http://blog.csdn.net/fetch001/article/details/7561453string类适用于描述字符串事物。那么它就提供了多个方法对字符串进行操作以下是string的七种用法,注意哦,记得要时常去查看java的API文档,那个里面也有很详细的介绍1,获取1.1:字符串中包含的字符数,也就是字符串的长度。int length():获取长度1.2:根据位置获取位置上某个字符。char charAt(int index)1.3:根据字符获取该字符在字符串中的位置。int indexOf(int ch):返回的是ch在字符串中第一次出现的位置。int indexOf( 阅读全文

posted @ 2013-03-04 18:53 Sure_Yi 阅读(199) 评论(0) 推荐(0) 编辑

Java Date类 currentTimeMillis()

摘要: Date类例: int b[] = new int[100000]; long begin = System.currentTimeMillis(); for (int i = 0; i < 100000; i++) b[i] = i * 10; long over = System.currentTimeMillis(); System.out.println(over - begin);结果:3 阅读全文

posted @ 2013-03-04 17:08 Sure_Yi 阅读(135) 评论(0) 推荐(0) 编辑

Java 中 参数 值传递 , 引用传递

摘要: http://www.blogjava.net/jiafang83/archive/2007/10/23/155412.html传值---传递基本数据类型参数publicclassPassValue{static void exchange(int a, int b){//静态方法,交换a,b的值int temp;temp = a;a = b;b = temp;}public static void main(String[] args){int i = 10; int j = 100;System.out.println("before call: " + "i 阅读全文

posted @ 2013-03-04 16:34 Sure_Yi 阅读(182) 评论(0) 推荐(0) 编辑

Java String, StringBuffer, StringBuilder

摘要: StringBuffer (StringBuffer 使用方法跟StringBuilder差不多,下面):http://www.360doc.com/content/06/1214/11/15458_293495.shtmlStringBuffer : 使用方法:http://www.cnblogs.com/gmh/archive/2008/05/13/1195670.html例: char ar[] = new char[5]; str.append("abcdefgh"); str.getChars(0, 3, ar, 1); for (int i = 0; i < 阅读全文

posted @ 2013-03-04 14:34 Sure_Yi 阅读(262) 评论(0) 推荐(0) 编辑

Java 数据类型(基本类型,引用类型)

摘要: 1.基本类型:char,byte,short,int,long,float,double,String2.引用类型:(1)由以上基本类型包装的 Char,Byte,Short,Intege,Long,Float,Double(2)对于引用类型,若一个变量引用的是一个复杂的数据结构的实例,则该变量的类型就属于引用类型,在引用类型变量所引用的实例中,不仅可以包含基本类型的变量,还可以包括对这些变量进行操作的行为。http://www.isstudy.com/java/1566.html 阅读全文

posted @ 2013-03-04 12:42 Sure_Yi 阅读(317) 评论(0) 推荐(0) 编辑

Java 集合,Map(Set List Map)

摘要: http://java.chinaitlab.com/Struts/832347.htmlJava集合种类:Set (集): HashSet TreeSethttp://bbs.csdn.net/topics/200071086List (列表): ArrayList LinkedListhttp://www.blogjava.net/wonderer/archive/2007/12/27/171019.htmlMap(映射): HashMap TreeMap http://www.blogjava.net/coderdream/archive/2007/10/31/157202.htmlSe 阅读全文

posted @ 2013-03-04 12:35 Sure_Yi 阅读(185) 评论(0) 推荐(0) 编辑

导航