Encapsulation in Scala Programming Language

  • date 8th October, 2020 |
  • by Prwatech |
  • 0 Comments

Encapsulation :

1.     Getter() – Methods that are used to access the value of a variable of a class/trait, Getting the values of variables is easy and can be done just by calling the name of the variable with the object name

2.     Setter() – Method that is used to set the value of a variable of a class/trait, Setting the values of variables is easy and can be done just by calling the name of the variable with the object name.

Abstraction:

It is an is an OOP concept that focuses only on relevant data of an object. It hides the background details and emphasizes the essential data points for reducing the complexity and increase efficiency. It generally retains only information which is most relevant for that specific process.It is the feature oops concept where it can be created using keyword “abstract”.

It is allowed within :

1. class

2. Variable

3. function

Quick Support

image image