I\'m creating server and client java applications. I would like to create an array to store my sockets in. I\'m using eclipse, and when I type in this line:
The resources defined in a try-with-resources block must all be auto-closeable. That's what it's for. Socket[] is not AutoCloseable, so it cannot be defined there. Move the declaration before the try. Ditto for any other resources you get the error on. Don't treat it as a general declaration block. It isn't.