what is the basic Difference Between following PrintWriter(File file) and PrintWriter(FileWriter writer)
The PrintWriter(File file) constructor creates a PrintWriter object that writes to the specified file.
The PrintWriter(FileWriter writer) constructor doesn't exist but there is a PrintWriter(Writer writer) constructor which creates a PrintWriter object that writes to the specified Writer which in your code is a FileWriter.
and in what scenario i should use these classes
The PrintWriter(File file) constructor is provided as a shortcut to save you having to create you own FileWriter. The PrintWriter(Writer writer) constructor can be used to pass in any type of Writer and so can be used where you don't know/care what type of Writer you will be writing to. Generally speaking, if you are creating the PrintWriter to write to a file and have a File object (or file name) then use the PrintWriter(File file) constructor otherwise use the PrintWriter(Writer writer) constructor.