adspace


can any one tell me what is advantage of encapsulation

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Realized?

2278


What is a constructor overloading in java?

1136


explain different ways of using thread? : Java thread

1092


Differentiate between static and non-static methods in java.

1135


Write a java program to find the route that connects between Red and Green Cells. General Rules for traversal 1. You can traverse from one cell to another vertically, horizontally or diagonally. 2. You cannot traverse through Black cells. 3. There should be only one Red and Green cell and at least one of each should be present. Otherwise the array is invalid. 4. You cannot revisit a cell that you have already traversed. 5. The maze need not be in the same as given in the above example

2677


What is the difference between break and continue statements?

1135


What is java string pool?

1091


How to sort array in descending order in java?

1005


Write a program to find the whether a number is an Armstrong number or not?

1110


What is an object in java and how is it created?

1154


What are the differences between heap and stack memory in java?

1153


Explain public static void main(string args[]) in java.

1089


What is the difference between equals() and == in java?

1050


Is minecraft 1.15 out?

1056


What is parsing in java?

1052