Explain in detail about encapsulation with an example?

Answers were Sorted based on User's Feedback



Explain in detail about encapsulation with an example?..

Answer / ravikiran(aptech mumbai)

encapsulation is the one which will bind members and methods
into a single entity

Is This Answer Correct ?    10 Yes 2 No

Explain in detail about encapsulation with an example?..

Answer / sanjay singh chauhan

it is way to combine field and mathod in a single entity
like a capsule ;
class A
{
int i;
void m(int i)
{
//body of this mathod ;
}
}
like this way;

Is This Answer Correct ?    7 Yes 0 No

Explain in detail about encapsulation with an example?..

Answer / aditya mohata

encapsulation is hiding detalis which u dont wanna show it
publicly or u dont want it to b modified.

Is This Answer Correct ?    10 Yes 5 No

Explain in detail about encapsulation with an example?..

Answer / sivaprasad addepalli

Encapsulation is a mechanism which binds the attributes or
variables and methods together as a single entity known as
class.
ex:
class sample
{
public:
int a;
public:
void test()
{
}
}
Encapsulation is a concept of datahiding,

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More Core Java Interview Questions

How concurrent hashmap works?

0 Answers  


What is clipping?

2 Answers  


What is parsing a string?

0 Answers  


How does queue work in java?

0 Answers  


Is integer passed by reference in java?

0 Answers  






What method is used to compare two strings ?

4 Answers  


What is the purpose of void?

0 Answers  


In java, how many ways you can take input from the console?

0 Answers  


What is formatted output in java?

0 Answers  


Is hashmap thread safe?

0 Answers  


how session will be expired ?

4 Answers   Satyam,


What do you understand by abstract classes?

0 Answers   HCL,


Categories