Main function inside the class ?

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jan 2009
Posts: 7
Reputation: vasunttfshimoga is an unknown quantity at this point 
Solved Threads: 0
vasunttfshimoga vasunttfshimoga is offline Offline
Newbie Poster

Main function inside the class ?

 
0
  #1
Feb 10th, 2009
why we have to declare the main function inside the class and we have to save the file name ( .java) as the class (which contains the main function) name why............what's the reason ?

Can we use another name for the saving the .java file ...........
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,501
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 521
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: Main function inside the class ?

 
0
  #2
Feb 10th, 2009
The reason is The Java Language Specification - that is just how it is.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 706
Reputation: stultuske is a jewel in the rough stultuske is a jewel in the rough stultuske is a jewel in the rough 
Solved Threads: 84
stultuske's Avatar
stultuske stultuske is offline Offline
Master Poster

Re: Main function inside the class ?

 
0
  #3
Feb 11th, 2009
Originally Posted by vasunttfshimoga View Post
Can we use another name for the saving the .java file ...........
off course you can, you just won't be able to compile the file any more, that's all.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC