Java基础

2018-04-10

    public void setSGGoldCoin(int sgGoldCoin) {
        sgGoldCoin = sgGoldCoin;
    }

    public void setSGGoldCoin(int sgGoldCoin) {
        this.sgGoldCoin = sgGoldCoin;
    }

今天算长见识了,因为手快(复制|粘贴),写了出了第一段代码,造成的结果是,修改无效,晕死,浪费了好多时间。

2018-05-01

引用博客:https://blog.csdn.net/u013256816/article/details/50417822

捕捉线程里面的异常。(如果是单个线程,设置UncaughtExceptionHandler属性)

Thread thread = new Thread(new Task());  
thread.setUncaughtExceptionHandler(new ExceptionHandler());  
thread.start(); 

 全局设置线程异常监听

Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler());  

2018-10-18

一直只知道synchronized锁,原来还有Lock锁

https://blog.csdn.net/cdw8131197/article/details/52601559

原文地址:https://www.cnblogs.com/angelshelter/p/8780536.html