This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance 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: 20552
57
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