Creating Objects the Simple Way : new « Class « Ruby






Creating Objects the Simple Way


class Customer
@@no_of_customers=0
end

cust1 = Customer.new
cust2 = Customer.new

 








Related examples in the same category

1.Creating Objects by Passing Parameters to the New Method