As the title already says, I would like to know if it is somehow possible to give a class a different filename in Java with Eclipse ?
Edit: I only want to know if its possible with Eclipse. If you don’t know the answer, please resist the urge to respond with condescending answers.
Edit2: It’s hilarious what kind of responses I get here. All I wanted to know is if it is possible to have a class with a different filename (and I meant the public class) and nothing else. I thought this is the kind of forum to ask these questions, but the second response I got was already an insult. Is this some kind of taboo question or what is going on ?
I don’t know why you would like to do that but it is possible if you compile files from command line with help of symbolic links.
Let’s say you have
class YourClasssaved in a fileOtherName.java. If you create a symbolic link to that file like this:UNIX system: (for sure doesn’t work on Solaris – other system aren’t verified)
WINDOWS system: (works on Windows Vista/2008+)
the compiler finds the type and compilation works…
This solution is not verified on Unix systems, but works for sure on Windows Vista/2008+..