昊天SEO

练习2 注释和井号–笨方法学ruby在线

程序里的注释是很重要的。它们可以用自然语言告诉你某段程序代码的功能是什么。在你想要临时移除一段程序代码时,你还可以用注释的方式将这段程序代码临时禁用。接下来的练习将让你学会注释:

# A comment, this is so you can read your program later.
# Anything after the # is ignored by Ruby.

puts "I could have code like this." # and the comment after is ignored

# You can also use a comment to "disable" or comment out a piece of code:
# print "This won't run."

puts "This will run."

本文地址官网    新乡网站建设,seo

分享到:更多 ()