Thursday, March 15, 2012

Hello, world!

Here’s how to get a computer to output the words “Hello, world!” using two popular computer languages:

In Java:

class Hello {

                         public static void main(String args[]) {

                        System.out.println(“Hello, world!”);

          }

}

the same thing in Ruby:

print “Hello, world!”

That’s it, the entire executable. No wonder programmers love Ruby.

No comments: