Variables in a Class : Variables « Language Basics « Ruby
- Ruby
- Language Basics
- Variables
Variables in a Class
# The global variables are always preceded by the dollar sign ($).
# using the class variable @@no_of_customers
class Customer
@@no_of_customers=0
end
Related examples in the same category