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 |
What is native class in java?
What is stateless in java?
Spring framework ---Can somebody explain me in easily understandable format about AOP, IOC and DI, so that i can explain in interview rather than just telling what is available in net. I am not able to understand that also. I am new to Spring
what about jdb and javadoc by example ?
Is jprofiler open source?
Why we need method overriding in JAVA ? I mean which method I have to override I can write that method in my Class.
What is exe file in java?
What is persistence xml in java?
What are all the documents have you involved in preparation of a Project as a Project Lead?
How do I install jdk?
suppose we have one String s="india is my country"; now we get the o/p "like country my is India". what is the logic?
what is constructer?what are the type of constructer with example.