![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
c472769019
111
展开
-
java中找不到某个类
问题:用Eclipse进行Java编程时,查看类的源代码,按 Ctrl+鼠标 左键,出现The source attachment does not contain the source for the file xxx.class, You can change the source attachment by clicking Change Attached Source below:转载 2017-11-04 16:01:33 · 3215 阅读 · 0 评论 -
java list大数据量用addAll
问题是这样产生的,网上一哥们发了一个面试题:ListA 里面有 1 2 3 ListB里面有 4 5 6 让ListA变成 1 2 3 4 5 6 我觉得很简单 ,就说用for循环遍历 添加就好了。结果面试官说答案是使用addAll方法,因为这样效率高:我表示很费解,于是查阅了资料。得出以下结论:在小数据量时,for循环效率...转载 2018-07-19 09:20:58 · 3028 阅读 · 0 评论 -
单例(Singleton)
1. 单例(Singleton)Intent确保一个类只有一个实例,并提供该实例的全局访问点。Class Diagram使用一个私有构造函数、一个私有静态变量以及一个公有静态函数来实现。私有构造函数保证了不能通过构造函数来创建对象实例,只能通过公有静态函数返回唯一的私有静态变量。 ImplementationⅠ 懒汉式-线程不安全以下实现中,私有静态变量 u...转载 2018-12-08 14:39:50 · 110 阅读 · 0 评论