• Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt On Java Compiler  RSS feed

 
Jagan Reddy
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a small doubt. I have a java file named "HELLO.java". I am able to compile it as "javac hello.java".Though java is case sensitive i am able to get the class file.But i am not to run it as "java hello" and i have execute the class file as "java HELLO".
How is this possible???
Thanx in advance.
Regards,
Reddy.



 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because the javac command uses your OS to find the file to compile. Your OS may or may not be case sensitive. However, the java (interpreter) command uses the JVM to find the class that has been loaded into it, and the JVM is always case sensitive.

-Nate
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!