Ruby class - Fix and debug | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Ruby class - Fix and debug

Correct the only error to make this code functioning: class Counter @@count = 0 def initialize @@count += 1 end def self.getCount @@count end end c1 = Counter.new puts c1.getCount

1st Aug 2019, 7:34 PM
Paolo De Nictolis
Paolo De Nictolis - avatar
2 Answers
0
Is this by any chance for homework or for something you were tasked to work on?
1st Aug 2019, 7:47 PM
Faisal
Faisal - avatar
0
For homework
2nd Aug 2019, 4:06 AM
Paolo De Nictolis
Paolo De Nictolis - avatar