Thursday, February 26, 2009

Hello World in Various Languges

C++
----

#include
using namespace std;

int main()
{
cout << "Hello, World!\n";
}

Java
----

class HelloWorld {

public static void main(String [] args) {

System.out.println("Hello World");
}
}

Erlang
------

-module(hello).
-export([hello_world/0]).

hello_world() -> io:fwrite("Hello, world!\n").


Groovy
------

println "Hello, world!"

Ruby
-----

puts 'Hello, world!'

Scala
-----

object HelloWorld with Application {
println("Hello, world!")
}

Even though this is a very simple program in different languages Ruby and Groovy stand out from the rest in terms of language simplicty.

No comments: