Using ` LinkedBlockingQueue` may cause null pointer exception
问题 I am learning java concurrent programming recently. I know that the final keyword can guarantee a safe publication. However, when I read the LinkedBlockingQueue source code, I found that the head and last field did not use the final keyword. I found that the enqueue method is called in the put method, and the enqueue method directly assigns the value to last.next . At this time, last may be a null because last is not declared with final . Is my understanding correct? Although lock can