| Author |
why public class should be stored in same filename as of class?
|
Nancy Antony
Ranch Hand
Joined: Sep 06, 2007
Posts: 142
|
|
Hi Ranchers, I'd like to know why .java file should have same name as of public class ? Nancy
|
 |
Jan Cumps
Bartender
Joined: Dec 20, 2006
Posts: 2343
|
|
Have a look at this post. It's your java platform that decides whether this is enforced or not. Regards, Jan
|
OCUP UML fundamental
ITIL foundation
|
 |
Mark Vedder
Ranch Hand
Joined: Dec 17, 2003
Posts: 624
|
|
|
Imagine the nightmare of trying to find a class' source file if you could name it anything you wanted... (without using an IDE that is.) Some one could save the "AccountInformation" class in a file named "FileSystemDeleteMechanism.java". And believe me, there are people that would do such crazy things if Java didn't prevent it. To me, it just one of those common sense rules they put into Java. And I for one am glad it is there.
|
 |
 |
|
|
subject: why public class should be stored in same filename as of class?
|
|
|