How encapsulation and abstraction defined/used in C#.NET.

Answers were Sorted based on User's Feedback



How encapsulation and abstraction defined/used in C#.NET...

Answer / gitesh sankhe

Encapsulation has two faces; data abstraction and
information hiding. Data abstraction is a type seen from
the outside. Information hiding is a type seen from the
inside.

Abstraction focuses on the outside view of an object (i.e.
the interface)
Encapsulation (information hiding ) prevents clients from
seeing its inside view, where the behavior of the
abstraction is implemented

Is This Answer Correct ?    8 Yes 1 No

How encapsulation and abstraction defined/used in C#.NET...

Answer / siva prasad

encapculation: binding the data members and member functions
together is called
encapculation. encapculation is done through class.
abstraction: hiding the implementaion details form usage or
from view is
called abstraction.
ex:
int x;
we don't know how int will internally work. but we know int
will work.
that is abstraction.

Is This Answer Correct ?    5 Yes 0 No

How encapsulation and abstraction defined/used in C#.NET...

Answer / sanjay vishwakarma

Encapsulation:
Encapsulation is a process of binding the data members and
member functions into a single unit.
Example for encapsulation is class. A class can contain data
structures and methods.
Consider the following class
public class Aperture
{
public Aperture ()
{
}
protected double height;
protected double width;
protected double thickness;
public double get volume()
{
Double volume=height * width * thickness;
if (volume<0)
return 0;
return volume;
}
}
In this example we encapsulate some data such as height,
width, thickness and method Get Volume. Other methods or
objects can interact with this object through methods that
have public access modifier

Abstraction:
Abstraction is a process of hiding the implementation
details and displaying the essential features.
Example1: A Laptop consists of many things such as
processor, motherboard, RAM, keyboard, LCD screen, wireless
antenna, web camera, usb ports, battery, speakers etc. To
use it, you don't need to know how internally LCD screens,
keyboard, web camera, battery, wireless antenna, speaker’s
works. You just need to know how to operate the laptop by
switching it on. Think about if you would have to call to
the engineer who knows all internal details of the laptop
before operating it. This would have highly expensive as
well as not easy to use everywhere by everyone.
So here the Laptop is an object that is designed to hide its
complexity.

Is This Answer Correct ?    3 Yes 0 No

How encapsulation and abstraction defined/used in C#.NET...

Answer / animesh

Encapsulation means hiding the inner details from the user
For eg. We know that to open a lock we put key inside it
but what key will do inside the lock is hiddden. We use
inheritance for encapsulation similarly we use Abstract
classes to define abstraction in C#.

Is This Answer Correct ?    17 Yes 16 No

How encapsulation and abstraction defined/used in C#.NET...

Answer / shamim nayab

Encapsulation:
Encapsulation is defined as the process of enclosing
data and function within a physical or logical package.
Abstraction:
Abstraction and encapsulaion are different but related
features.Abstraction enables to make the relevent
information visible

Is This Answer Correct ?    1 Yes 0 No

How encapsulation and abstraction defined/used in C#.NET...

Answer / raj

Encapsulation Means Wrapping up of data and methods into a single unit (Class).

Abstraction Means Hiding the Details of method implementation(Interface)

Is This Answer Correct ?    1 Yes 0 No

How encapsulation and abstraction defined/used in C#.NET...

Answer / ramanathan

holding the deails togather.wrapping updata and methods
together..tis is called Encapsulation..
hiding details.Hiding the implementations of methods in a
classby use of objects..this is called Abstraction..

Is This Answer Correct ?    10 Yes 10 No

How encapsulation and abstraction defined/used in C#.NET...

Answer / sp

Encapsulation is the process of hiding details from the
outside of the source.
Abstraction is the process of hiding details from other than
the child's.

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More C Sharp Interview Questions

What?s the difference between the Debug class and Trace class?

2 Answers  


How do I count the length of a string in c#?

0 Answers  


Is array ienumerable c#?

0 Answers  


What happens if a static constructor throws an exception?

0 Answers  


How many types of serialization are there in c#?

0 Answers  






Perfect Example Of While And Do-While Loop In C#.Net ?

0 Answers   Wipro,


What is a multi line comment?

0 Answers  


what is IEquatable

0 Answers   Wipro,


What are the different types of classes?

0 Answers  


Does c# do array bounds checking?

0 Answers  


What debugging tools come with the .NET SDK? CorDBG

1 Answers  


Does c# replace c++?

0 Answers  


Categories