Advertisement

Udemy WW Udemy WW
Showing posts with label problem with JDK 7. Show all posts
Showing posts with label problem with JDK 7. Show all posts

Monday, 28 November 2011

Can we execute static block without main()

YES....static block can  execute without main() if we are using previous version of JDK
It will not supported by JDK 7..
class Demo
{
static{
System.out.println("helllo.....");
System.exit(0);
}
}
static block will execute if we compile and interpret above code with previous version of JDK (not supported by jdk7)


Advertisement

Udemy WW