[Solved] Simple Java Query


Whenever you need to run anything ,you always need a starting point,

So Java language developers decided to have this main Method as starting point of execution.

and So your code does not compile ,because these statements cannot be directly in class. Only variable declarations are allowed directly inside class,everything else needs to go inside some method or initialization blocks.

Hope this helps!

Good luck!

solved Simple Java Query