CodeGym didn't close the stream in their proposed correct Solution , although it was asked by the tast . Did that try-block replace that ?