The main method must be a static method. In Scala to create a static method you put it in an object. Methods in a class are not static.In the scala language they decided to separate class, which hold only instance behavior and state, and object which hold static behavior and state.This is different from java where classes hold both instance and static members where something is made static using the static keyword.
No comments:
Post a Comment