When writing to a file in Java what happens if you choose a
When writing to a file in Java, what happens if you choose a file that already exists? What if you choose a file that does not exist?
Also, where in a method should you declare that it throws an exception?
Solution
If file already exist then it create a new file deleting older content.
If file does not exit, it creates a new file
So, in either case it create a new file.
At place where you create a FIle Object and you read/write to file, it should declare throws an exception
