Classic Hello world! program with a class

#!/usr/bin/env ruby # Classic Hello world! program with OOP class HelloWorld def hello (name) puts "Hello world!, I am " + name end end me = "Adolfo" object1 = HelloWorld.new() object1.hello (me)

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.