Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is java case sensitive

 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

java file name is Test.java
i have compiled this java source file using this command javac TEst.java
and also with this command javac Test.java
it worked well

can any one tell me why it does??

thanking you in advance

cinux
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Presumably, you were using an O/S with case-insensitive file system (Windows or, under some circumstances, Mac OS X). Under such an O/S, Java compilation typically will work even when you use the "wrong" case.

However, you should get into the habit of using the "right" case, even on such O/S, so that your files will still work correctly on a case-sensitive file system (e.g. Unix).
 
Rajah Nagur
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its got nothing to do with Java..it is got to do with OS. Windows is case insensitive while *nix is case sensitive. Try the same thing in any Unix flavour...it bombs..
 
Naseem Khan
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by saikrishna cinux:

java file name is Test.java
i have compiled this java source file using this command javac TEst.java
and also with this command javac Test.java
it worked well

can any one tell me why it does??



Here is a small test for you to check whether java is case sensitive or not?

Run your program by typing java TEst and tell us your output?

I hope you got your answer


Thanks & Regards


Naseem
[ June 30, 2006: Message edited by: Naseem Khan ]
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as said, under some OS's the compiler doesn't care. The runtime though always cares.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic