With most things covered, here are a few:
- Main should not be throwing an exception. Instead Log it or make a function call which throws the exception and catch it in main with proper logs. http://stackoverflow.com/questions/17629321/throwing-exception-in-main-method https://stackoverflow.com/questions/17629321/throwing-exception-in-main-method
- Do we really want to exit if you get a number beyond the range. Instead, we could log it, ignore it and just continue with the rest. Your call.
- Can arr be null or with size less than the array size you require. Have a validation there.
- Be specific with your imports and remove unused ones. http://stackoverflow.com/questions/8401523/difference-between-complete-package-import-and-specified-class-import-java https://stackoverflow.com/questions/8401523/difference-between-complete-package-import-and-specified-class-import-java
- Be specific with your exception be it while throwing or catching. http://www.javaworld.com/article/2073800/testing-debugging/beware-the-dangers-of-generic-exceptions.html
With most things covered, here are a few:
- Main should not be throwing an exception. Instead Log it or make a function call which throws the exception and catch it in main with proper logs. http://stackoverflow.com/questions/17629321/throwing-exception-in-main-method
- Do we really want to exit if you get a number beyond the range. Instead, we could log it, ignore it and just continue with the rest. Your call.
- Can arr be null or with size less than the array size you require. Have a validation there.
- Be specific with your imports and remove unused ones. http://stackoverflow.com/questions/8401523/difference-between-complete-package-import-and-specified-class-import-java
- Be specific with your exception be it while throwing or catching. http://www.javaworld.com/article/2073800/testing-debugging/beware-the-dangers-of-generic-exceptions.html
With most things covered, here are a few:
- Main should not be throwing an exception. Instead Log it or make a function call which throws the exception and catch it in main with proper logs. https://stackoverflow.com/questions/17629321/throwing-exception-in-main-method
- Do we really want to exit if you get a number beyond the range. Instead, we could log it, ignore it and just continue with the rest. Your call.
- Can arr be null or with size less than the array size you require. Have a validation there.
- Be specific with your imports and remove unused ones. https://stackoverflow.com/questions/8401523/difference-between-complete-package-import-and-specified-class-import-java
- Be specific with your exception be it while throwing or catching. http://www.javaworld.com/article/2073800/testing-debugging/beware-the-dangers-of-generic-exceptions.html
With most things covered, here are a few:
- Main should not be throwing an exception. Instead Log it or make a function call which throws the exception and catch it in main with proper logs. http://stackoverflow.com/questions/17629321/throwing-exception-in-main-method
- Do we really want to exit if you get a number beyond the range. Instead, we could log it, ignore it and just continue with the rest. Your call.
- Can arr be null or with size less than the array size you require. Have a validation there.
- Be specific with your imports and remove unused ones. http://stackoverflow.com/questions/8401523/difference-between-complete-package-import-and-specified-class-import-java
- Be specific with your exception be it while throwing or catching. http://www.javaworld.com/article/2073800/testing-debugging/beware-the-dangers-of-generic-exceptions.html
lang-java