Viktor Kubinec wrote:
Andrew Vershinin wrote:
Campbell Ritchie wrote:Welcome to the Ranch
2. If you miss out the main method - it will cause an error, and code inside initializer will not be executed.
This is not right. The code inside initializer will be executed and then the error will be thrown (NoSuchMethodError : main)
Campbell Ritchie wrote:And what if you try it in Java6?
Campbell Ritchie wrote:Welcome to the Ranch
Campbell Ritchie wrote:What happens if you try that in Java7? Particularly if you miss out the main method?