aspose file tools*
The moose likes Java in General and the fly likes is java   case sensitive Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "is java   case sensitive" Watch "is java   case sensitive" New topic
Author

is java case sensitive

saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
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


A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
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).


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Rajah Nagur
Ranch Hand

Joined: Nov 06, 2002
Posts: 239
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..


You can't wake a person who is <b><i>pretending</i></b> to be asleep.<br />Like what <b>"it"</b> does not like - <i> Gurdjieff </i>
Naseem Khan
Ranch Hand

Joined: Apr 25, 2005
Posts: 809

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 ]

Asking Smart Questions FAQ - How To Put Your Code In Code Tags
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
as said, under some OS's the compiler doesn't care. The runtime though always cares.


42
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: is java case sensitive