今天看一個單例模式的時候例子時候發(fā)現(xiàn)這樣的一個語法,可是我自己百度沒發(fā)現(xiàn)有講這個的,希望有懂的解釋一下,代碼中間的不需要,謝謝。
Runnable task = ()->{
String threadName = Thread.currentThread().getName();
Singleton s = Singleton.getInstance();
System.out.println("線程 " + threadName + "\t => " + s.hashCode());
};
添加回答
舉報
0/150
提交
取消