• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

what is wrong with this code ?

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


When i try to save the code in eclipse for Test1.java under package pack iam getting file name collision error.Aren't the class names and the interface names in java case sensitive ?
Thanks
-Badri
 
lowercase baba
Posts: 13091
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes, they are. But Windows is NOT case sensitive, if that is the OS you are using.
 
Badri Narayanan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Fred
 
Ranch Hand
Posts: 1274
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ranchers,

what Fred wrote cannot be the cause.

I'm using Eclipse 3.1 in WindowsXP and had no problems to put Test1 and test1 into one file named Test1. Maybe you have already a class or interface with that name(s) in this package?

Try to make a variable Test1 xy; or test1 yz;
If there's already such a class it will work, otherwise Eclipse marks this as "cannot be resolved to a type".

Consider the class can be in a file with different name and does not necessarily occur in the package explorer of eclipse.


Yours,
Bu.
 
fred rosenberger
lowercase baba
Posts: 13091
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I assumed that the class Test1 was in one file named "Test1.java", and that the interface was defined in a second file name "test1.java". My assumption may not have been correct.

if not, then yes, I would make sure there isn't already a previous test1.java file from some other project out there.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The two class files would have the same name, too, so if they're in the same package, regardless of the source file names, on Windows one file will clobber the other. It may seemingly work in Eclipse, but you'll fail to be able to deploy the application.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic