Bear Bibeault wrote:"user-friendly" is not applicable. A language cannot be 'user-friendly" or not. The programs you create with a language can be user-friendly or not. And that all depends upon how you use the language, not on the language itself.
I assume you meant "programmer-friendly"?
Jeff Verdegan wrote:
Aman Kulkarni wrote:
John Jai wrote:I don't quite understand the question - but using javac you compile a .java file that can contain many classes within it. The file name should be identical with the public class declared.
So I can save the below code in some file say "Hai.java" and when I compile the java file I get three class files - SomeOther, Outer$Inner and Outer
So in the above case...which class name shall I use in order to get the output ???
There's no code there that produces any output, so the answer to your question is "none."
When you ask "which class name shall I use", are talking about which class name to provide on the command line when you launch the JVM? If so, then the answer is always, "The class whose main method you want to execute as your program's entry point."
Stephan van Hulst wrote:That seems non-intuitive. Throwing and handling exceptions are polar opposites. When you use the throws keyword on a method signature, it doesn't mean the method handles the exception. It means it may throw that exception under certain circumstances, and code calling the method should deal with the possibility that that particular exception may be thrown.
It doesn't make sense on the class level. So no, you can't do this.
John Jai wrote:I don't quite understand the question - but using javac you compile a .java file that can contain many classes within it. The file name should be identical with the public class declared.
So I can save the below code in some file say "Hai.java" and when I compile the java file I get three class files - SomeOther, Outer$Inner and Outer
Bear Bibeault wrote:
Aman Kulkarni wrote:So why don't you tell me the actual parameter of selection of the class name
Getting snarky with people who are volunteering their time to try and help you is not a strategy for success. I'd strongly advise a reconsideration of your approach.
Henry Wong wrote:
Aman Kulkarni wrote:
Stephan van Hulst wrote:If you did that, what should it mean?
I haven't tried it yet due to some java unavailability...I am for holidays and the only thing I have is the internet connection...So thought of asking it !
You don't need availability to java to answer the question. Let's assume that it was allowed, what would you expect it to do... After all, you asked why we can't use a feature? You should have an idea of what this feature will do right?
Henry
Stephan van Hulst wrote:If you did that, what should it mean?
Jeff Verdegan wrote:
Aman Kulkarni wrote:Keeping the class name and name of the file same is an unwritten rule...some follow...while some don't...
Yes, I know that, but it has nothing to do with the main method.