Yes, we can execute a java program without a main method by using a static block . Static block in Java is a group of statements that gets executed only once when the class is loaded into the memory by Java ClassLoader, It is also known as a static initialization block.
Read moreIs a main class necessary in Java?
Yes, the Main method is required to run a function although a java class can be without the Main method.27 Oca 2016
Read more