πŸ“Š Ruby
Q. Which statement is used to declares code to be called before the program is run?
  • (A) Start
  • (B) Begin
  • (C) Here
  • (D) End
πŸ’¬ Discuss
βœ… Correct Answer: (B) Begin

Explanation: Begin is used to declares code to be called before the program is run.

πŸ“Š Ruby
Q. Which character is used to give comment in ruby?
  • (A) $
  • (B) !
  • (C) @
  • (D) #
πŸ’¬ Discuss
βœ… Correct Answer: (D) #

Explanation: The hash character (#) is used to give comment in ruby.

πŸ“Š Ruby
Q. Block comment conceals several lines from the interpreter with?
  • (A) =begin and =end
  • (B) =start and =end
  • (C) =here and =end
  • (D) =begin and =ending
πŸ’¬ Discuss
βœ… Correct Answer: (A) =begin and =end

Explanation: This block comment conceals several lines from the interpreter with =begin/=end.

πŸ“Š Ruby
Q. Which of the following is a Reserved Words in Ruby?
  • (A) do
  • (B) or
  • (C) in
  • (D) all of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) all of the above

Explanation: All of the above is a Reserved Words in Ruby.

πŸ“Š Ruby
Q. Which of the following is supported by Ruby?
  • (A) Dynamic Type System
  • (B) Multiple Programming Paradigms
  • (C) Automatic Memory Management
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above

Explanation: Ruby supports all the features because it is a object oriented programming language.

πŸ“Š Ruby
Q. Which of the following features does the 2.0 version of ruby supports?
  • (A) New literals
  • (B) Security fixes
  • (C) Method keyword arguments
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above

Explanation: Ruby2.0 has several new added features and it is much stable than its older versions.

πŸ“Š Ruby
Q. Which of the following languages syntax matches with the Ruby's syntax?
  • (A) C
  • (B) Perl
  • (C) PHP
  • (D) Java
πŸ’¬ Discuss
βœ… Correct Answer: (B) Perl

Explanation: Most of the syntax of perl language matches with that of Ruby's.

πŸ“Š Ruby
Q. What is the extension used for saving the ruby file?
  • (A) .rb extension
  • (B) .ruby extension
  • (C) .rrb extension
  • (D) .rbb extension
πŸ’¬ Discuss
βœ… Correct Answer: (A) .rb extension

Explanation: Ruby files must be saved with the extension .rb.

πŸ“Š Ruby
Q. Which of the following are valid floating point literal?
  • (A) 0.5
  • (B) 5
  • (C) ---
  • (D) ---
πŸ’¬ Discuss
βœ… Correct Answer: (A) 0.5

Explanation: floating point literals are valid only when they have digits on both the sides of decimal point.

πŸ“Š Ruby
Q. Ruby 2.7.1 version release date?
  • (A) 31-03-2019
  • (B) 31-01-2020
  • (C) 31-03-2020
  • (D) 31-04-2019
πŸ’¬ Discuss
βœ… Correct Answer: (C) 31-03-2020

Explanation: Ruby 2.7.1 version release date 31-03-2020.