GMgKe586q6suSQnyqZLlGCooeWM
Learn To Program
Increase Your Knowlegde and Build Your Skill!
Pages
Home
Me
Search
Monday, December 20, 2010
Method In Ruby
To say mooooo:
>> def sayMoo
>> puts 'Mooooooooooo...'
>> end
To call it, just type:
>> sayMoo
Method with parameter:
>> def sayMoo num
>> puts 'Mooooooooo...'*num
>> end
Call it by
>> sayMoo 5 # print 5 times
Method In Ruby
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment