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.

Scala - Variables
Scala - Objects & Classes
Shekhar Sharma

Shekhar Sharma

Shekhar Sharma is founder of testingpool.com. He is an automation engineer having more than 8 years of experience who loves troubleshooting in automation and finding innovative ways to solve the problems. His other leisurely activities includes playing harmonica, paintings, sketching portrait, watching movies and travelling etc.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *