I'm using a Logger class to log the errors occuring. But while creating a file I'm hard-coding the file location. which I'm not supposed to do. How do I specify a path which I don't want to hard-code in java?
Music is all around us. All you have to do is just LISTEN to it,
Hm, I would describe that Constants class as being hard-coded. You can't change the file location without recompiling. That's presumably what Sandeep is trying to avoid.
But Sandeep, I would say that a properties file is a flat file. To most of us, anyway. And a log4j.properties file is a kind of properties file, thus also a flat file. So probably this is what you need to do. If you think that's incorrect, then you should answer SV's question: what do you mean by flat files?