ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories >> Software >> Java-Related >> Java-J2EE >> Core-Java
 
 
 
Question
What is meant by Encapsulation? Can you write a class to
explain encapsulation?
 Question Submitted By :: Maria
I also faced this Question!!     Rank Answer Posted By  
 
Answer
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);
 
0
Rajasekhar
 
View All Answers
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com