What is encapsulation?

Encapsulation is restricting data and actions to object they are defined in. In other words, no other object can access and modify them directly. In Java encapsulation can be achieved by making an object or specific variable "private" instead of "public" (keep in mind that main method must be public). You can think of it as a literal capsule. You close data in such capsule so it is safe and you cannot really see or modify it from outside the capsule.

SJ
Answered by Sara J. Computing tutor

2432 Views

See similar Computing IB tutors

Related Computing IB answers

All answers ▸

What is data validation and data verification?


Explain the difference between the cache memory and the buffer.


The program I've written doesn't do what its supposed to! I don't have any errors, so I don't even know where to start looking for the problem. Where can I begin?


Define how recursion works


We're here to help

contact us iconContact ustelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

MyTutor is part of the IXL family of brands:

© 2026 by IXL Learning