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 is the maximum size of hashmap in java?

938


What does exclamation mean in java?

1015


What does singleton mean in java?

946


Can you override a final method?

981


Can a source file contain more than one class declaration?

912


Can you explain the final method modifier?

954


What is a method in coding?

995


What is meant by class loader? How many types are there?

1176


What is a byte string?

1051


What is the difference between iterator and enumeration ?

955


What is use of super keyword in java?

972


Can a class be private?

912


Can you extend singleton class?

1034


How can you generate random numbers in java?

984


What is the use of default method in interface in java?

964