Encapsulation can be achieved in the java program by:
- Creating an instance variables private so that will unable to be accessed directly from outside of a given class.
- Use getter and setter ways in the class to set and get the values of a given fields.
What is the Basic concepts of OOPS?
Object-oriented programming is known to be made up of four basic concepts such as:
- Encapsulation
- Abstraction
- Inheritance
Note that Encapsulation can be achieved in the java program by:
- Creating an instance variables private so that will unable to be accessed directly from outside of a given class.
- Use getter and setter ways in the class to set and get the values of a given fields.
Learn more about object-oriented programming from
https://brainly.com/question/14078098
#SPJ4