+ 2
in general you don't bro. because we're have to follow some standard rules defined by java. but sky is limit. so it is possible with the help of Static initializer block. public class Sample { static{ System.out.println("Hello, World!"); } } if it does not work then simply call System.exit(0) after printing message .
7th Nov 2016, 9:11 AM
Harish Nandoliya
Harish Nandoliya - avatar