How to handle Java Exception

We had introduced JavaException in 2 articles: Understand Java Exception & The effect to Java Program (Single & Multi Thread) & How to work with Java Custom Exception. In the tutorial, JavaSampleApproach will show you how to handle Java Exception.
Related post:
How to use Spring Exception Handler for SpringMVC: @ExceptionHandler, @ResponseStatus, @ControllerAdvice

Continue reading “How to handle Java Exception”

Understand Java Exception & The effect to Java Program (Single & Multi Thread)

In the tutorial, JavaSampleApproach will introduce Java Exception and its effect to program’s execution in Single & Multi Thread Program.
Related post:
Java 7 – try-with-resources Statement
How to handle Java Exception

Continue reading “Understand Java Exception & The effect to Java Program (Single & Multi Thread)”

How to write Text File in Java by BufferedWriter

Java provides a BufferedWriter for writting content to File with high performance when performing with large number of write action. Because BufferedWriter decreases I/O interaction by using internal buffer to write data into File.
Related posts:
1. Java Read Text File by BufferedReader, Java 7,Java 8
2. How to delete non-empty Folder in Java

Continue reading “How to write Text File in Java by BufferedWriter”

How to delete non-empty Folder in Java

Java supports a function: java.io.File.delete() to delete a File or an empty directory. But with non-empty folders, we need to implement function to delete them. In the tutorial, JavaSampleApproach will show you how to develop a recursive funtion to delete non-empty Folder.

Continue reading “How to delete non-empty Folder in Java”