why do we have atmost one public class in a source file
divyasheel sharma
Greenhorn
Joined: Feb 15, 2001
Posts: 19
posted
0
Dear friends, Pls explain me why do we have only one public class atmost in a source file and why the class name shall match the unextended file name, is this a convention? Why? Rgds Divya
------------------ Eat Java,Drink Java...surf only Javaranch!
Eat Java,Drink Java...surf only Javaranch!
Daniel Searson
Ranch Hand
Joined: Dec 03, 2000
Posts: 83
posted
0
Hi Divya, The reason for this is to force a coding convention onto programmers. If you are looking at somebody else's source, then all you should be interested in is the public classes. If the public classes are in files of the same name, its easy to find them. I believe thats the the theory anyway...
------------------ - Daniel
- Daniel
divyasheel sharma
Greenhorn
Joined: Feb 15, 2001
Posts: 19
posted
0
Thanks Daniel! -Divya ------------------ Eat Java,Drink Java...surf only Javaranch!