1.

Choose the filemode method which is used to create a new output file with the condition that the file with same name if exists will destroy the old file:(a) FileMode.CreateNew(b) FileMode.Create(c) FileMode.OpenOrCreate(d) FileMode.TruncateThis question was addressed to me at a job interview.This is a very interesting question from Byte Stream topic in division Console I/O Operations and Stream Classes of C#

Answer»

The CORRECT CHOICE is (b) FileMode.Create

The EXPLANATION: CREATES a new output FILE. Any pre-existing file with the same name will be destroyed.



Discussion

No Comment Found

Related InterviewSolutions