Key Concepts

Review core concepts you need to learn to master this subject

Ruby Variables

myVar = 48

In Ruby, a variable is a place to store values of almost any type including Integer, Boolean, String, Array, and Hashes.

Each variable has its own name which cannot begin with a capital letter or a number and we use the equal sign for assigning a value to that variable.

The variable declaration does not require that you mention a specific data type.

The following program declares myvar variable and assigns the value 48.

Introduction to Ruby
Lesson 1 of 2