07 2015 档案

摘要:当synchronized关键字修饰一个方法的时候,该方法叫做同步方法。 Java中的每个对象都有一个锁(lock),或者叫做监视器(monitor),当一个线程访问某个对象的synchronized方法时,将该对象上锁,其他任何线程都无法再去访问该对象的synchronized方法了。直到之... 阅读全文
posted @ 2015-07-31 10:00 秦凯 阅读(154) 评论(0) 推荐(0)
摘要:public static void main(String[] args) { Gson gson = new Gson(); List persons = new ArrayList(); for (int i = 0; i () { }... 阅读全文
posted @ 2015-07-30 11:10 秦凯 阅读(102) 评论(0) 推荐(0)
摘要:public static void main(String[] args) { Map map = new HashMap(); map.put("1", "张三"); map.put("2", "李四"); map.put("3", "王... 阅读全文
posted @ 2015-07-28 13:44 秦凯 阅读(232) 评论(0) 推荐(0)
摘要:List list = new ArrayList(); /** * 方法一:最普通的不加思考的写法 * * 优点:较常见,易于理解 * * 缺点:每次都要计算list.size() ... 阅读全文
posted @ 2015-07-27 13:33 秦凯 阅读(7211) 评论(0) 推荐(0)
摘要:用 @Deprecated注解的程序元素,不鼓励程序员使用这样的元素,通常是因为它很危险或存在更好的选择。在使用不被赞成的程序元素或在不被赞成的代码中执行重写时,编译器会发出警告。 阅读全文
posted @ 2015-07-23 11:37 秦凯 阅读(265) 评论(0) 推荐(0)
摘要:使用SimpleExecutor.class 文件进行调试 阅读全文
posted @ 2015-07-23 11:04 秦凯 阅读(218) 评论(0) 推荐(0)
摘要:首先添加Eclipse 2.0 Style Plugin Support 支持1、Help-->install new software-->Add 输入http://download.eclipse.org/eclipse/updates/4.42、仅勾选Eclipse 2.0 Style Plu... 阅读全文
posted @ 2015-07-03 15:58 秦凯 阅读(200) 评论(0) 推荐(0)