Execute Java program without main method

preview_player
Показать описание
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
}
Рекомендации по теме
welcome to shbcf.ru