Class in java
Is it necessary to save my source file in java with "class name.java". If not then what is the condition?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Jan 9, 2014, 1:21 PM
It follows from this that a .java file can have at most one public class.
If a .java file contains no public class, then you can name it what you like.
However, there's a lot to be said for having only a single class (public or not) per file and always giving it the same name as the class.