1// Java Program to demonstrate till Java JDK5 version
2// without main() method is possible.
3class WithoutMainMethod {
4static {
5int i = 2, j = 4, sum;
6sum = i + j;
7System.out.println("The sum of i and j is :" + sum);
8System.out.println("This program is without main() valid till JDK 5 version");
9}
10}