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 / rajasekhar

It is the ability of an object to hide its data and methods
from the rest of the world.

A Class may contains a few members in the form of
properties,events,fields or methods.These members of the
class are not exposed to the outer world directly.Rather
they are ENCAPSULATED by the Class.

Public Class Calculations
{
Private void fnMultiply(int x, int y)
{
return x*y;
}
}

Calculations Obj;
int Result;
Result = Obj.fnMultiply(5,10);

Is This Answer Correct ?    19 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are different types of inner classes ?

1102


What are the different tags provided in jstl?

1004


What is serialversionuid?

1159


What methodology can be employed to locate substrings inside a string?

999


Can finally block be used without a catch?

1063


Why we use protected in java?

1027


What is the default value of an object reference declared as an instance variable?

1176


Why can't we use static class instead of singleton?

998


What are the 8 primitive data types in java?

1084


What is Session reduplication and how its done?

2087


When do you call copy constructor?

1027


How does java enable high performance?

1201


What is methods in java?

1051


What are the actions that can occur when a thread enters blocked state?

1112


What is null object in java?

1059