Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java core

 
gunjan deogam
Greenhorn
Posts: 11
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why only public static void main(String arg[]) use in java, why there is void return type, why not int, float etc.
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic