Ruby

All Questions for: Ruby

Question 151: In Ruby, what is the keyword used to define a class?

  • A class
  • B cls
  • C defclass
  • D define

Explanation: The correct answer to the question is: class

Question 152: Ruby is an object oriented general purpose programming language.

  • A False
  • B True

Explanation: The correct answer to the question is: True

Question 153: What is the data type of the value "Hello, World" in Ruby?

  • A Boolean
  • B Integer
  • C Float
  • D String

Explanation: The correct answer to the question is: String

Question 154: What is the output of the the given code?

  • A My name is #{Name}
  • B Undefined Error
  • C Error in compilation
  • D Name variable not defined earlier

Explanation: The correct answer to the question is: Name variable not defined earlier