Scala – Classes & Objects

OOps is that correct? Scala is always related to Functional Programming. However, as you may have guessed by now it also supports Object-Oriented Programming constructs. We can in Scala use OOPs & FP constructs in quite interesting ways. But before we start doing that let’s just start looking at the basics of Scala classes. Scala improves upon Java classes in some ways. It does away with a lot of boiler-plate code which the developers needed to write during Java development. Some of those concepts are discussed below. Keep in mind that all this is already well known and if you are a Java developer it is just a slightly different syntax and a few features thrown in which make the life of a developer a bit easy(Supposedly!) Let’s begin with a Basic syntax. See Below In the above example, we create a class called color which has a public method … Read more