What is the Notation used for denoting class variables in Ruby?
Submitted by: MuhammadIn Ruby,
☛ A constant should begin with an uppercase letter, and it should not be defined inside a method
☛ A local must begin with the _ underscore sign or a lowercase letter
☛ A global variable should begin with the $ sign. An uninitialized global has the value of “nil” and it should raise a warning. It can be referred anywhere in the program.
☛ A class variable should begin with double @@ and have to be first initialized before being used in a method definition
Submitted by: Muhammad
☛ A constant should begin with an uppercase letter, and it should not be defined inside a method
☛ A local must begin with the _ underscore sign or a lowercase letter
☛ A global variable should begin with the $ sign. An uninitialized global has the value of “nil” and it should raise a warning. It can be referred anywhere in the program.
☛ A class variable should begin with double @@ and have to be first initialized before being used in a method definition
Submitted by: Muhammad
Read Online Ruby Developer Job Interview Questions And Answers
Top Ruby Developer Questions
☺ | Tell us what is class libraries in Ruby? |
☺ | Tell me can you call a private method outside a Ruby class using its object? |
☺ | Explain me what is the function of ORM in Ruby on Rails? |
☺ | Tell me the role of modules and mixins in Ruby? |
☺ | What is the difference extend and include? |
Top Web Developer Categories
☺ | Bootstrap Interview Questions. |
☺ | Front End Web Developer Interview Questions. |
☺ | Typography Interview Questions. |
☺ | Laravel PHP Developer Interview Questions. |
☺ | Junior Developer PHP Interview Questions. |