Ruby - Class Methods and Variables
Which of the following is the correct way to define a class instance variable in Ruby?
@count = 0 correctly inside the class body. @@count = 0 uses class variables (@@), which are different. def @count; @count; end is invalid method syntax. self.@count = 0 is invalid syntax.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions