Monday, 1 February 2016

Simple Ruby Program

Let us write a simple program in ruby. All Ruby files will have extension .rb So,create file myruby.rb

puts "Hello, Welcome to dryruby.blogspot.in"

Now, try to run this program in command line

$ruby myruby.rb
+---------------------------------------------------------------------------------------------+
 Hello, Welcome to dryruby.blogspot.in
+---------------------------------------------------------------------------------------------+
puts "content to display"-- is used to display contents.

Class 

classes are a blue-print for constructing computer models for real or virtual objects.
OR

classes hold data, have methods that interact with that data, and are used to instantiate objects.
   

No comments:

Post a Comment