Anayonkar Shivalkar wrote:By the way, why there is System.exit(0) in static block?
This code is an answer to the age-old question 'How do you start a
java application without a main() method? The answer is you can use a static block to start the application instead. But at the end of the block you need to use System.exit(0) to prevent the JVM throwing an error saying the main method couldn't be found.