Tags

, ,

A couple of weeks ago, I started reading up on the Scala programming language.

Before even referring to a book, I downloaded all the tools, namely the Scala compiler, Eclipse for Scala and IntelliJ IDEA for Scala. The next step was to look for samples on the Internet. Having found a few samples, I copied them and executed them successfully.

Then I decided to try out a simple application on my own.

I defined a class, added the ‘main’ method and a few statements inside ‘main’. I tried executing the application, but was not able to do so. I tried for quite some time, before giving up and picking up a book. It was while reading the book that the penny dropped.

My mistake was simple. I had put the ‘main’ method inside a class. To run the application, the ‘main’ method has to be inside an ‘object’.

Thus, my Java background proved to be a hangover while programming in Scala.

Advertisements