Q2
How do you open a file in Ruby in write mode, creating it if it does not exist?
A.
File.create("filename.txt", "w")
B.
File.write("filename.txt", "w")
C.
File.open("filename.txt", "w")
AnswerD.
File.new("filename.txt", "w")
Answer: Option C
Solution
Answer: Option C
No explanation is given for this question Let's Discuss on Board