摘要: Collection 接口 |--List 接口,继承Collection |--ArrayList --- implement List |--Vec... 阅读全文
posted @ 2017-04-03 22:32 2637282556 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 1ArrayList: 底层数据结构是数组,查询快,增删慢线程不安全,效率高 查询快原因: 底层数据结构是数组,数组有索引,索引的作用相当于字典中的字母,通过这个字母,查到对应区域,不要一个一个字区比较。所以查询块. 增删慢原因: 底层结构... 阅读全文
posted @ 2017-04-03 21:27 2637282556 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 格式: 修饰符 返回值类型 方法名(类型 参数1,类型 参数2,类型… 可变参数变量名){ }注意: 这里的变量其实是一个数组 如果一个方法有多个参数和可变参数,可变参数要放到最后一个package cn;public class Tes... 阅读全文
posted @ 2017-04-03 18:32 2637282556 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 定义: 是一种把明确类型的工作推迟到创建对象或者调用方法的时候才去明确的特殊的类型。泛型高级 ?:任意类型,如果没有明确,那么就是Object以及任意的Java类了 ? extends E:向下限定,E及其子类 ? super E:向上限定,E极其父类1.自定义泛型类... 阅读全文
posted @ 2017-04-03 18:04 2637282556 阅读(113) 评论(0) 推荐(0) 编辑
摘要: List集合:有序,可重复的存储数据A:添加功能 void add(int index,Object element):在指定位置添加元素 B:获取功能 Object get(int index):获取指定位置的元素 C:列表迭代器 ... 阅读全文
posted @ 2017-04-03 16:44 2637282556 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Collection树形图Collection 接口 |--List 接口,继承Collection |--ArrayList --- implement List ... 阅读全文
posted @ 2017-04-03 13:45 2637282556 阅读(136) 评论(0) 推荐(0) 编辑
摘要: System不能被实例化:常用方法:public static void gc():运行垃圾回收器。 具体什么时候回收有算法决定。public static void exit(int status) status=0终止当前正在运行的 Java 虚拟机。非0异常终... 阅读全文
posted @ 2017-04-03 12:12 2637282556 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Random:产生随机数 public Random():没有给种子,用的是默认种子,是当前时间的毫秒值, public Random(long seed):给出指定的种子, 等价于new Random().setSeed(seed); public int next... 阅读全文
posted @ 2017-04-03 12:07 2637282556 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Math:用于数学运算的类。参数大多为double或者float类型成员变量:public static final double PI 3.141592653589793public static final double E 2.718281828459... 阅读全文
posted @ 2017-04-03 11:21 2637282556 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 1Calendar常用方法:int get(int field) 返回给定日历字段的值。 static Calendar getInstance() 使用默认时区和语言环境获得一个日历。 static int YEAR 指示年的 get 和 set 的字... 阅读全文
posted @ 2017-04-03 11:00 2637282556 阅读(225) 评论(0) 推荐(0) 编辑
摘要: BigDecimal:不可变的、任意精度的有符号十进制数,可以解决数据丢失问题。适用于为了能精确的表示、计算浮点数。 常用方法:public BigDecimal add(BigDecimal augend) 加public BigDecimal subtract(B... 阅读全文
posted @ 2017-04-03 02:39 2637282556 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 特点: 线程安全的可变字符串。适用于字符串的拼接,同步,效率低 构造方法public StringBuffer():无参构造方法public StringBuffer(int capacity):指定容量的字符串缓冲区对象public StringBuffer(Str... 阅读全文
posted @ 2017-04-03 01:47 2637282556 阅读(338) 评论(0) 推荐(0) 编辑
摘要: 这里以Integer类型举例: Integer a =1; a +=2;编译后.calss文件是这样的Integer a = Integer.valueOf(1); 自动装箱 a = Integer.valueOf(a.intValue... 阅读全文
posted @ 2017-04-03 01:11 2637282556 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 1构造方法public Integer(int value)public Integer(String s)2常用方法 static String toString(int i, int x) 将数字i转为x进制表示的值 static int parseInt(Str... 阅读全文
posted @ 2017-04-03 01:04 2637282556 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 常用的方法:public static boolean isUpperCase(char ch):判断给定的字符是否是大写字符public static boolean isLowerCase(char ch):判断给定的字符是否是小写字符public static ... 阅读全文
posted @ 2017-04-03 00:48 2637282556 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 1冒泡排序 相邻比较,大的放右边,最大值在索引最大处 for(int i=0;iarr[m+1]){ int temp=arr[m]; arr[m]=arr[m+1]; ... 阅读全文
posted @ 2017-04-03 00:09 2637282556 阅读(100) 评论(0) 推荐(0) 编辑