what is meant by Encapsulation?Explain with an example?

Answers were Sorted based on User's Feedback



what is meant by Encapsulation?Explain with an example?..

Answer / rekha

ENCAPSULATION MEANS WRAPPING DATA MEMBERS & MEMBER FUNCTION
IN A SINGLE UNIT.EXA:-CLASS

Is This Answer Correct ?    12 Yes 1 No

what is meant by Encapsulation?Explain with an example?..

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

what is meant by Encapsulation?Explain with an example?..

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 meant by Encapsulation?Explain with an example?..

Answer / mahi

combined together
ex:tablet

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More Java Related AllOther Interview Questions

Are streams faster than for loops?

0 Answers  


What is jpa entitymanager?

0 Answers  


What is jersey in java?

0 Answers  


Can I have multiple main methods in the same class?

0 Answers  


Please tell what are frames,pannel,container,jframe,jpannel and what are there relation?

1 Answers   TCS,






What do you understand by casting in java language? What are the types of casting?

0 Answers  


How do I enable java in firefox?

0 Answers  


What are orm tools in java?

0 Answers  


What is a pojo class in java?

0 Answers  


Which framework is best for rest api java?

0 Answers  


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

0 Answers  


What is the use of rs next () in java?

0 Answers  


Categories