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  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
What is encapsulation?
 Question Submitted By :: Abalonesoft
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is encapsulation?
Answer
# 1
Preventing unauthorized access to some piece of information
or functionality. 

The key money-saving insight is to separate the volatile
part of some chunk of software from the stable part.
Encapsulation puts a firewall around the chunk, which
prevents other chunks from accessing the volatile parts;
other chunks can only access the stable parts. This prevents
the other chunks from breaking if (when!) the volatile parts
are changed. In context of OO software, a "chunk" is
normally a class or a tight group of classes. 

The "volatile parts" are the implementation details. If the
chunk is a single class, the volatile part is normally
encapsulated using the private and/or protected keywords. If
the chunk is a tight group of classes, encapsulation can be
used to deny access to entire classes in that group.
Inheritance can also be used as a form of encapsulation. 

The "stable parts" are the interfaces. A good interface
provides a simplified view in the vocabulary of a user, and
is designed from the outside-in (here a "user" means another
developer, not the end-user who buys the completed
application). If the chunk is a single class, the interface
is simply the class's public member functions and friend
functions. If the chunk is a tight group of classes, the
interface can include several of the classes in the chunk. 

Designing a clean interface and separating that interface
from its implementation merely allows users to use the
interface. But encapsulating (putting "in a capsule") the
implementation forces users to use the interface.
 
Is This Answer Correct ?    0 Yes 0 No
Abalonesoft
[Abalonesoft Technologies]
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
what is array? HCL22
i want explaination about the program and its stack reprasetaion fibbo(int n) { if(n==1 or n==0) return n; else return fibbo(n-1)+fibbo(n-2); } main() { fibbo(6); }  2
How to write a program for swapping two strings without using 3rd variable and without using string functions. iGate5
CopyBits(x,p,n,y) copy n LSBs from y to x starting LSB at 'p'th position. Adobe4
plssssss help !!....using array.. turbo c.. create a program that will accept number of words to be consored. .a word must not exceed 10 characters long .the text to be entered will be no longer than 200 characters .there will be no 10 words example: enter number of words to be censor: 5 enter words to censor: windows office microsoft bill gates enter text to censor: bill gates founded microsoft and makes office and windows sample output: <consored> <censored> founded <censored> and makes <censored> and <censored>  1
Who is invented by c? Infosys14
differentiate between const char *a; char *const a; and char const *a; HCL1
What is the memory allocated by the following definition ? int (*x)(); ADITI2
how to print "hai" in c?  10
what is the return value (status code) of exit() function.... what the arguments(integer value) passed to it means.... TCS1
main() { int arr[5]={23,67}; printf("%d%d%d",arr[2],arr[3],arr[4]); } TCS6
What character terminates all strings composed of character arrays? 1) 0 2) . 3) END  3
write the function int countchtr(char string[],int ch);which returns the number of timesthe character ch appears in the string. for example the call countchtr("she lives in Newyork",'e') would return 3.  4
How to Clear last bit if it 1 using Macro TURN_OFF_BIT_LAST Adobe2
int *a[5] refers to TCS8
If we give two names then this displays the connection between the two people. It is nothing but flames game  1
what will happen if you free a pointer twice after allocating memory dynamically ? Novell2
N O S I E R + A S T R A L ---------------- 7 2 5 6 1 3 Honeywell2
write a program to find the sum of the array elements in c language?  8
what are the difference between ANSI C and Let Us c and Turbo C LG-Soft1
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
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