computer






 

Question by  malamuth (52)

What is encapsulation in Java?

 
+6

Answer by  archie (73)

One of the four fundamental OOP or object oriented programming concepts is Encapsulation. The other three are abstraction, inheritance and polymorphism. Encapsulation is the way of making the fields in a class private and by using via public methods it can provide access to the fields. This technique is also called data hiding.

 
+5

Answer by  zomb (64)

Encapsulation is all about how you organize your data inside classes. Making class variables private and only exposing necessary data through accessor and modifier functions is encapsulation at work.

 
+4

Answer by  brilliance (54)

One of four fundamental OOP concepts, the others being inheritance, polymorphism, and abstraction. Encapsulation makes a class's fields private, and allow users to access them through public methods. A private field is not accessible to anyone outside the class, thus, this is, also, know as data hiding.

 
+3

Answer by  KLR (606)

Encapsulation is a object oriented programming concept. It refers to hiding details from the user of an object. The user only calls the object methods.

 
You have 50 words left!