Ruby help!! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

Ruby help!!

what is the difference between @@ , @ and $?! Thanks for your help 💚

23rd Feb 2018, 5:52 AM
Baraa AB
Baraa AB - avatar
3 Answers
+ 5
A variable prefixed with @@ is a class variable and one prefixed with @ is an instance variable.
23rd Feb 2018, 6:13 AM
Jonas Heinzmann
Jonas Heinzmann - avatar
+ 5
Complementing the response a variable with the dollar symbol ($) is a global variable
23rd Feb 2018, 1:20 PM
Mickel
Mickel - avatar
+ 4
thanks a lot <3
28th Feb 2018, 8:10 PM
Baraa AB
Baraa AB - avatar