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 can I check single byte, double byte of character in JTextField?(eg. japan unicode and English unicode)

0 Answers  


Is java built on c?

0 Answers  


What is cdi bean in java?

0 Answers  


Is it better to learn java or python?

0 Answers  


Why do we only use the main method to start a program?

0 Answers  


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

0 Answers  


What is a stream in programming?

0 Answers  


What are the new features about Java se 8 ?

0 Answers  


What are the disadvantages of java sockets?

0 Answers  


how ahstraction is the property of oops,this is also in c and c++ ex. printf function which is also hide the unnecessary data,so what is the difference ? and does c++ fallow the abstraction?

0 Answers  


What is a flatmap?

0 Answers  


cant we call run() method directly instead of calling indirectly through the start() method ? if we do so then what is the problem ?

7 Answers   HSBC, Subex,


Categories