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

Why java uses the concept of the string literal?

0 Answers  


What is advantage of using threads?

2 Answers   BMC,


Explain the difference between getAppletInfo and getParameterInfo?

1 Answers  


What is a method in java?

0 Answers  


What is the difference between Resultset and Rowset.

6 Answers   IBM, Wipro,






I need some details about an employee. i have only the employee id in my presentation layer(JSP).I entered that ID and click "Show Details" Button. Question is how the JSP pass that id to Controller layer and DAO and what mechanism we are using to retrive data from DB and how the data passed to JSP as a Output. Please explain in detail.

1 Answers   TCS,


What are the legal operands of the instanceof operator?

0 Answers  


Explain different types of thread priorities ?

0 Answers  


Is java map thread safe?

0 Answers  


What is race condition ?? (Threading concept) TCS 2 sept10

3 Answers   SparkTG, TCS,


How much is a java license?

0 Answers  


Is arraylist sorted in java?

0 Answers  


Categories