Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is meant by Encapsulation? Can you write a class to
explain encapsulation?

Answer Posted / sivakishorereddy(badvel)

-Encapsulation is wrapping of data(Data members) and
associated methods(member functions) into a single unit in
such a way that data can be accessed with the help of
associated methods.
--In a class we can specify the variables(Data members) as
private. So for other classes it will not be accessible.
--Through methods(member functions) only we can access the
member variables or modify them.
--It gives more security for our data. It is nothing but
data hiding.

Is This Answer Correct ?    19 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is indexof?

977


How can I right-justify a string?

1167


Explain listiterator and methods in listiterator?

1013


What are "class access modifiers" in Java?

1124


Which is better arraylist or vector?

1020


How do you do descending order in java?

964


What is the meaning of immutable regarding string?

962


Which variables are stored in stack?

895


For class CFoo { }; what default methods will the compiler generate for you>?

1069


What are the benefits of operations in java?

1040


Why are the objects immutable in java?

983


Do I need java for windows 10?

1035


If an application has multiple classes in it, is it okay to have a main method in more than one class?

1010


What is string :: npos?

1077


Can a constructor call another constructor?

981