Kalpana,
You can't exactly "print a file" in Java, but depending upon what type of data is in the file, you may be able to read its contents and print them using Java's printing capabilities. You might take a look at the java.awt.print package, and in particular, the PrinterJob class in that package. If you have trouble figuring out how to do the printing, I'd encourage you to consider picking up a copy of my book, as it contains a chapter that describes in detail how to use Java's printing capabilities.
------------------
Brett Spell
Author,
Professional Java Programming