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

How should I format my code? How should I comment my code?

0 Answers  


How does java handle integer overflows and underflows?

0 Answers  


Why dependency injection is used in java?

0 Answers  


What is the meaning of loosely coupled in java?

0 Answers  


What is dialect in java?

0 Answers  






What happens if javac is not recognized?

0 Answers  


I have deployed a .war file in my application server comprising of struts and hibernate.If i want to change the "dialect" property of hibernate cfg file how can i change(I have only .war file)... Thanks in advance

0 Answers  


What is meant by annotation in java?

0 Answers  


What is lambda expression in mvc?

0 Answers  


What is the difference between jar and executable jar?

0 Answers  


What do you mean by exception handling?

0 Answers  


What is dao in java?

0 Answers  


Categories