dcsimg

How do I create a Selector (java.nio.channels)?

John Zukowski

While the Selector class is abstract, you can create one by calling the static open() method. This will create an instance of a Selector subclass. Behind the scenes, this is done through the selector provider:

SelectorProvider.provider().openSelector()