Answer Posted / maddy

Data Encapsulation is the process of combining data and
functions into a single unit called class. By this method
one cannot access the data directly. Data is accessible
only through the functions present inside the class. Thus
Data Encapsulation gave rise to the important concept of
data hiding.

Example:

public class class1
{
void role1();
void role3();
}

class1 c=new class1();
c.role1();
c.role3();

---
dotnetpages.blogspot.com

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are strings immutable in c++?

650


What is type of 'this' pointer?

596


What is a constant? Explain with an example.

553


What does I ++ mean in c++?

581


What are put and get pointers?

577






What is the output of the following program? Why?

620


What are abstract data types in c++?

529


What is virtual table?

613


What are the two types of comments, and how do they differ?

572


In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?

584


Describe the role of the c++ in the tradeoff of safety vs. Usability?

711


How can you differentiate between inheritance and implementation in c++?

640


Can we specify variable field width in a scanf() format string? If possible how?

658


How do you clear a map in c++?

566


What are pointer-to-members? Explain.

624