Can a Java program run without main?

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.

Sizin İçin Seçtik  Ar-Ge politikasi nedir?

Leave a Reply

Your email address will not be published. Required fields are marked *