This set of Ruby Programming Multiple Choice Questions & Answers (MCQs) focuses on “Basics”.
1. Ruby is an object oriented general purpose programming language.
a) True
b) False
View Answer
Explanation: Ruby allow users to manipulate data structures called objects to build and execute programs.
2. Which of the following is supported by Ruby?
a) Multiple Programming Paradigms
b) Dynamic Type System
c) Automatic Memory Management
d) All of the Mentioned
View Answer
Explanation: Ruby supports all the features because it is a object oriented programming language.
3. Which of the following features does the 2.0 version of ruby supports?
a) Method keyword arguments
b) New literals
c) Security fixes
d) All of the mentioned
View Answer
Explanation: Ruby2.0 has several new added features and it is much stable than its older versions.
4. Which of the following languages syntax matches with the Ruby’s syntax?
a) Perl
b) PHP
c) Java
d) Jquery
View Answer
Explanation: Most of the syntax of perl language matches with that of Ruby’s.
5. What is the extension used for saving the ruby file?
a) .ruby extension
b) .rb extension
c) .rrb extension
d) None of the mentioned
View Answer
Explanation: Ruby files must be saved with the extension .rb.
6. Which of the following are valid floating point literal?
a) .5
b) 2
c) 0.5
d) None of the mentioned
View Answer
Explanation: floating point literals are valid only when they have digits on both the sides of decimal point.
7. Ruby can be embedded into Hypertext Markup Language(HTML).
a) True
b) False
View Answer
Explanation: Ruby can easily be encapsulated into HTML.
8. It is must for Ruby to use a compiler.
a) True
b) False
View Answer
Explanation: No compiler is required for ruby as it is an interpreted language.
9. Ruby can be used for developing internet and intranet applications.
a) True
b) False
View Answer
Explanation: Ruby is a server side scripting language used to create CGI(common gateway interface) scripts and hence can be used for developing internet and intranet applications.
Sanfoundry Global Education & Learning Series – Ruby Programming.
To practice all areas of Ruby Programming, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Check Ruby Programming Books
- Practice Programming MCQs
- Check Information Technology Books
- Apply for Programming Internship