Scala – OOPs concepts
Scala combines object-oriented and functional programming in one concise, high-level language. The name Scala comes from the word scalable, and true to that name, it’s used to power the busiest websites in the world, including Twitter, Netflix, Tumblr, LinkedIn, Foursquare, and many more.
Scala is a pure object oriented programming language. Every value is an object, and every “operator” is a method.For example, when you say 1 + 2 in Scala, you are actually invoking a method named + defined in class Int.
It’s also a functional programming (FP) language, so functions are also variables, and you can pass them into other functions. You can write your code using OOP, FP, or combine them in a hybrid style.
In principle, the motivation for object-oriented programming is very simple: most programs need some sort of structure. The great idea of object-oriented programming is to put data and operations into some form of containers and make them fully general and they themselves treated as values can be stored in containers or passed as parameters to operations. Such containers can be called as objects. We will study more about OOPs concepts in detail in coming chapters.