What is the purpose of List<Void>?
问题 I didn't even know this was doable, but I saw while perusing some code online a method with a signature like this: public List<Void> read( ... ) ... What? Is there ever a reason to do this? What could this List even hold? As far as I was aware, it's not possible to instantiate a Void object. 回答1: It is possible that this method signature was created as a by-product of some generic class. For example, SwingWorker has two type parameters, one for final result and one for intermediate results.