filmov
tv
Execute Java program without main method

Показать описание
Q. Can we execute the java program without the main method?
Answer: Yes, We can execute the java program without the main method using static block and testNG. But after java 1.6 static block is not supported.
@Test
public static void test() {
//your code
}
static {
//your code
}
Answer: Yes, We can execute the java program without the main method using static block and testNG. But after java 1.6 static block is not supported.
@Test
public static void test() {
//your code
}
static {
//your code
}