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.

Answered by Sara J. Computing tutor

1673 Views

See similar Computing IB tutors

Related Computing IB answers

All answers ▸

Question 14)http://ibdocuments.com/IB%20PAST%20PAPERS%20-%20SUBJECT/Group%204%20-%20The%20sciences/Computer_science_SL/2007%20November%20Examination%20Session/English%20Papers/Computer_science_paper_1_SL.pdf


What is a network protocol and why do we need it?


How do you convert a number between decimal and binary?


What is data validation and data verification?


We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2024

Terms & Conditions|Privacy Policy