Unfortunately I do not see what your are trying to achieve here or what is your objective after even creating this file. Would you mind explaining to us your actual objective.
What you have mentioned here appears to be a means to an end. If you tell us what that end may be we can suggest a better means.
In c#.net we can create .cs files using the namespace CodDom
This name space contains methodes for creating Constructors,functions,adding namespaces etc.Like this name space is there is anything in java.
My req is to create dynamically some java files inside a solution ,all these files contains some predefined methodes,constructors and variables.After completing the creation we can compile this java files.
Using BCEL we can create class files dynamically.Is there is any way
to create a java file .Because i am currently in a product dev and my current module is to create a java file dynamically.Please help..
decompile that BCEL generated class file, as BCEL does not create and then compile java files, it directly creates/modifies the byte code contained within the class files. Don't expect to get "pretty" code, though.
Once again though, there are generators for specific purposes.