Basics of classes and methods in scala