Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java core  RSS feed

 
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
Posts: 21047
85
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
Boost this thread!