4 posts / 0 new
Priyanka Singh

If the syntex is public static void main() then we can't  run that main method by creating the object.

If other main() are present inside the class for that method we can run by creating the object.

sabyasachi swain

No we can't run the main method by creating object.if we run it will show run time error.

Priyanka Singh
We can run main() method in java by creating object but if the main() method is static then no need to create the object.In java,we can call the static method by class name directly.