Given below is a Ruby code snippet with line numbers:
Note: A file named "test" is located at the location "/var/www/ruby/"
1. aFile = File.new("/var/www/ruby/test", "r")
2. if aFile
3. aFile.syswrite("RUBY Testing")
4. print "Done!"
5. else
6. puts "Unable to open file!"
7. end
What is the outcome when the above code is executed?
Correct Answer:
It gives an error on line number 3.
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Ruby MCQ Questions