what is meant by Encapsulation?Explain with an example?
Answers were Sorted based on User's Feedback
Answer / rekha
ENCAPSULATION MEANS WRAPPING DATA MEMBERS & MEMBER FUNCTION
IN A SINGLE UNIT.EXA:-CLASS
Is This Answer Correct ? | 12 Yes | 1 No |
Answer / sanjay deorari
Containing and hiding information about an object, such as
internal data structures and code.
Binding together of related data and functions to
perform some set of specific operations is encapsulation.
Is This Answer Correct ? | 4 Yes | 2 No |
Answer / santhosh kandula
Encapsulation is nothing but hiding the data.By using
encapsulation the ability to modify the code without
without breaking the code the other who use our code. In
Encapsulation we have to pass private members and access
via the public modifiers.
Example : public class EncapsDemo
{
private String str;
public String getString()
{
return str;
}
public void setString(String str)
{
this.str=str;
}
}
Is This Answer Correct ? | 2 Yes | 2 No |
Which framework is best for rest api java?
What is a flatmap?
how can program polindrome using java
What is the difference between a while statement and a do statement?
What is javabeans api?
What is an entity in java?
what is the package for freshers in valuelabs.
How do you check if java is installed on windows command prompt?
What is a java proxy?
How can c# app request minimum permissions? : java security
What is the meaning of the words public, static and void?
Is jpa a framework?