This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
The file system does not impose any naming constraint when creating. You would not want to use something that Windows associates with a particular program.
Personally I use .ser or something similar so I can recognize where a file came from.
Technically you can, but as William said Windows will not see that the file is not a text file or Word 2007 file. Therefore, double clicking the file will have Windows open the file with Notepad (or any other editor that is configured to open .txt files) or Word 2007. These programs can't properly display these files.
.ser is often used for files containing serialized objects, both because it makes it a bit clearer what the file contains and because .ser is not an extension used by popular applications. If you want you can use .vishal or any other thing you like. I usually use no extension at all.
Vishal Hegde wrote:FileOutputStream fs=new FileOutputStream("foo.ser");
is it cumpolsary to use only one extension that is .ser ?
cant we use .txt ,.docx etc