file1 = File.new("Sample", "r")# Thus the preceding statement should be written as:file1 = File.new("C:\\Ruby\\Sample", "r")file1.close