• +91 9723535972
  • info@interviewmaterial.com

Ruby Interview Questions and Answers

Question - What are Ruby arrays and how they can be created?

Answer -

Ruby arrays are ordered collections of objects. They can hold objects like integer, number, hash, string, symbol or any other array.

Its indexing starts with 0. The negative index starts with -1 from the end of the array. For example, -1 indicates last element of the array and 0 indicates first element of the array.

A Ruby array is created in many ways.

Using literal constructor []
Using new class method

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners