it doesn't quite store itself, as that would be infinitely recursive - it stores a sub-set of itself.
What do you mean by a 'robust method'? What are you actually trying do do? It would be much easier if you told us what you really want, rather than ask a vague question and then tell me my answer isn't what you were looking for.
what i want is write a simple java program and using Java API or some other way (Robust way) to print the program code itself.
note that in the program should print itself i without any duplication code. as it was in above example.