how java find main function. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how java find main function.

As I get, the main class inn a java code should be inside a class. And as i know preveiwsly in other languages for example c++, we shoud define and call classmethods to works. But here in hello eorld sample i see that the main method is inside of a class. so ho the compiler can find it without defining? If we have 2 classes what will hapend then? i guss it should be forbidden to have 2 classes with main methot. but my main questios is still how can it find "main?

26th Sep 2016, 3:46 AM
Hassan Bagheri Valoujerdi
Hassan Bagheri Valoujerdi - avatar
0 Answers