Open In App

Ruby Literals

Any constant value which can be assigned to the variable is called as literal/constant. we use literal every time when typing an object in the ruby code. Ruby Literals are same as other programming languages, just a few adjustments, and differences here.
These are following literals in Ruby.

  1. Booleans and nil
  2. Numbers or Integers
  3. Strings
  4. Symbols
  5. Ranges
  6. Arrays
  7. Hashes
  8. Regular Expressions

Type of Ruby Literals


Article Tags :