can any one tell me what is advantage of encapsulation

Answers were Sorted based on User's Feedback



can any one tell me what is advantage of encapsulation..

Answer / shalini

any programming lang. constitutes of two parts
1. logics 2. data
out of the above two, data is more important coz logics
lost can be rewritten but data once lost can never be
retrieved, hence data is more imp, but in the languages
like C and C++, there is a high chance of loosing the data
coz of the global variable concept, there is a very high
insecurity coz of global variables. So in order to overcum
the disadvantage of global var, encapsulation was
introduced, coz encapsulation eliminates the concepts of
global var, and the entire data is encapsulated at one
place, what u call it as class...hence encapsulation forms
the basis for OOPS concept

Is This Answer Correct ?    3 Yes 2 No

can any one tell me what is advantage of encapsulation..

Answer / phanindra

The Advantage of Encapsulation is we can achieve
Security,Durabilty and Maintainability.

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More Core Java Interview Questions

What about interrupt() method of thread class ?

0 Answers  


What java is used for?

0 Answers  


This is my code i have a doubt class ab implements a,b { public void add() { System.out.println("Hi") } } interface a { public void add(); } interface b { public void add(); } in this code i have two interface implemented in the class has same method.just i want to know which method of interface implemented in the class. interface a or interface b? confused me .

3 Answers  


What variables are stored in stack?

0 Answers  


Which variables are stored in heap?

0 Answers  






Explain the difference between private, public, package and protected in java?

0 Answers  


Explain the difference between jvm and jre?

0 Answers  


How does JAVA ClassLoader work?

1 Answers   IBM,


What is meant by local variable and instance variable?

0 Answers  


give an example for encapsulation?

0 Answers   Aspire,


How do you convert boolean to boolean?

0 Answers  


Can we start a thread twice in java?

0 Answers  


Categories