Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Ruby%20On%20Rails%20Interview%20Questions%20and%20Answers

Question: Describe the difference between class and instance variables?
Answer:
  • Class variables are created with the prefix ‘@@’ and are shared by all objects in a class.

  • Instance variables are created with the prefix ‘@’ and belong to a single object within a class.

Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook