aspose file tools*
The moose likes Beginning Java and the fly likes java core Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java core" Watch "java core" New topic
Author

java core

gunjan deogam
Greenhorn

Joined: Aug 02, 2009
Posts: 11

why only public static void main(String arg[]) use in java, why there is void return type, why not int, float etc.


Gunjan Deogam SCJP6, SCWCD5
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19720
    
  20

Because that's how Java is designed. As for the return type, what would it need to return? Granted, the operating system can use the return type of the application, but for Java you use System.exit for that.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
Don't get me started about those stupid light bulbs.
 
subject: java core