摘要:
HashMap 是内部基于哈希表实现,该类继承AbstractMap,实现Map接口 Hashtable 线程安全的,而 HashMap 是线程不安全的 Properties 类 继承了 Hashtable 类,而 Hashtable 类则继承Dictionary 类 HashMap允许将 null 阅读全文
摘要:
public class EqualsMethod { public static void main(String[] args) { Integer n1 = new Integer(47); Integer n2 = new Integer(47); System.out.print(n1 = 阅读全文
摘要:
public class Demo { public static void main(String args[]) { String str=new String("hello"); if(str=="hello") { System.out.println("true"); } else { S 阅读全文
摘要:
定义有StringBuffer s1=new StringBuffer(10);s1.append(“1234”)则s1.length()和s1.capacity()分别是多少? StringBuffer s = new StringBuffer(x); x为初始化容量长度s.append("Y") 阅读全文
摘要:
一、时间复杂度 (1)时间频度 一个算法执行所耗费的时间,从理论上是不能算出来的,必须上机运行测试才能知道。但我们不可能也没有必要对每个算法都上机测试,只需知道哪个算法花费的时间多,哪个算法花费的时间少就可以了。并且一个算法花费的时间与算法中语句的执行次数成正比例,哪个算法中语句执行次数多,它花费时 阅读全文