Ruby Developer Question:

Download Job Interview Questions and Answers PDF

What is the difference in scope for these two variables: @@name and @name?

Ruby Developer Interview Question
Ruby Developer Interview Question

Answer:

The difference in scope for these two variables is that:

☛ @@name is a class variable
☛ @name is an instance variable

Download Ruby Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Do you know what is the defined operator?Tell me how would you freeze an object in Ruby? Can you provide a simple example?