Tuesday, May 26, 2020

Java Exceptions



  • All RuntimeExceptions are unchecked exceptions rest of them are checked exceptions
  • Always use try-with-resource. In order to use objects  should implement AutoClosable
  • Exceptions are very slowly. Code running inside try-catch is performing slowly. If you have chance just use simple test (like if(!s.empty) s.pop() ) rather then guarded section
  • Throw early, catch late






Sources :




No comments:

Post a Comment

Thank you for your comment!