return type of main() method

Hi my doubt is is there can be any return type for main() method or main() method can return any type of data Can we over-ride main() method please provide an exampple for main() method overriding Kirankumartmkirankumar@gmail.com
[278 byte] By [kiran164812.a] at [2007-11-27 9:46:28]
# 1
No.
-Kayaman-a at 2007-7-12 23:57:02 > top of Java-index,Java Essentials,Java Programming...
# 2

> my doubt is is there can be any return type for main() method

Yes. The return type is void.

> or main() method can return any type of data

"The" main() method, no.

> Can we over-ride main() method please provide an exampple for main() method

> overriding

Again, for "the" main() method, no. Static methods cannot be overridden.

~

yawmarka at 2007-7-12 23:57:02 > top of Java-index,Java Essentials,Java Programming...
# 3

Yes. The method main can have any return type you desire, and take whatever parameters you want. It doesn't even have to be static, or public. Or final for that matter. It's your method

However, your JVM will only treat public static void main(String[]) as an entry point, so any changes to the prescribed signature will stop that method being recognized as an entry point

georgemca at 2007-7-12 23:57:02 > top of Java-index,Java Essentials,Java Programming...