answersLogoWhite

0

Encapsulation conceals the functional details of a class from objects that send messages to it.

For example, the Dog class has a bark() method. The code for the bark() method defines exactly how a bark happens (e.g., by inhale() and then exhale(), at a particular pitch and volume). Timmy, Lassie's friend, however, does not need to know exactly how she barks. Encapsulation is achieved by specifying which classes may use the members of an object. The result is that each object exposes to any class a certain interface - those members accessible to that class. The reason for encapsulation is to prevent clients of an interface from depending on those parts of the implementation that are likely to change in future, thereby allowing those changes to be made more easily, that is, without changes to clients. For example, an interface can ensure that puppies can only be added to an object of the class Dog by code in that class. Members are often specified as public, protected or private, determining whether they are available to all classes, sub-classes or only the defining class. Some languages go further: Java uses the default access modifier to restrict access also to classes in the same package, C# and VB.NET reserve some members to classes in the same assembly using keywords internal (C#) or Friend (VB.NET), and Eiffel and C++ allow one to specify which classes may access any member.

User Avatar

Wiki User

16y ago

What else can I help you with?

Continue Learning about Engineering

Give 6 characterstics of object oriented programming?

Actually these characterstics may differ from books to books. This is in general: #Data abstraction #Data Encapsulation #Inheritance #Polymorphism #Dynamic Linking #Static Binding Some books consider Objects & Classes also as one among these characteristics.


What is meant by inheritance?

In computer programming, inheritance means to derive a new object from an existing object, such that the new object inherits all the properties of the existing object. In object oriented programming, derived classes inherit the public and protected members of their base classes. This allows new classes to be created from existing classes, without the need to duplicate large chunks of code in the existing class. The new class can augment the inherited code to provide more specific behaviour.


What is the difference between traditional and object orientation?

A traditional approach, also known as structured system development, includes many variations which aim to develop information using structured and modular programming. On the other hand, an object oriented approach looks at the information system as a collection of objects that work together to accomplish a task.


What is meant by transient analysis?

it is the response of a system with respect to the input as a function of time


What is meant by instancing a class?

The class can be considered a template to create objects. When you create an object, you create it on the basis of the specified class - the object is an instance of the class, and the act of creating the object is also known as "instantiating" the class.

Related Questions

Give 6 characterstics of object oriented programming?

Actually these characterstics may differ from books to books. This is in general: #Data abstraction #Data Encapsulation #Inheritance #Polymorphism #Dynamic Linking #Static Binding Some books consider Objects & Classes also as one among these characteristics.


Why c is not support of object oriented?

1. C was meant to be simple. 2. C was developped before the OOP


What is meant by method in c?

Object oriented programming is to construct a software as interactions between objects. The interaction between objects are through the means of sending messages, or by invoking methods.


What are the reasons for rise of constructor concept in c?

Not sure what you mean by this. C is a not an object-oriented programming (OOP) language, and therefore has no constructor concept. You probably meant C++ but, even so, there is no "rise of constructor concept". Constructors are fundamental to OOP -- they allow you to initialise an object at the point of instantiation.


What is meant by inheritance in c plus plus language?

Inheritance in C++ and in other Object Oriented languages is the creation of a class that incorporates a different class. The child (or derived) class "inherits" all of the elements (attributes and methods) of the parent (or base) class. Depending on the design of the base class, the derived class can use methods and attributes of the base class as if they were its own. Typically, however, attributes of the base class are private to the base class and inaccessible to the derived class so as to maintain class hierarchy and data encapsulation.


What is meant by a multiplexed address and data bus?

[object Object]


What is meant by cocoa in objective c?

COCOA- an object-oriented programming API for Mac OS XCocoa is object oriented programming environments comprising of an integrated editor/compiler/interface builder and a set of frameworks (dynamically linked libraries) which store almost all of the typical objects (and their methods) you might want in an application. As well as Objective-C, Cocoa programs can also be written in Java, even AppleScript, perl or python.


What is meant by SAS how its useful?

Is a statistical analysis software, and used for ...


What is a literary analysis of the US Constitution?

it is what u meant by your self.


What is meant by an object has weight 80 newtons?

an object has its weigh 80 n


What is MICSAW analysis?

There's no such thing as MICSAW analysis, perhaps you meant MOSCOW?Must HaveShould HaveCould HaveWant to Have


What is meant by inheritance?

In computer programming, inheritance means to derive a new object from an existing object, such that the new object inherits all the properties of the existing object. In object oriented programming, derived classes inherit the public and protected members of their base classes. This allows new classes to be created from existing classes, without the need to duplicate large chunks of code in the existing class. The new class can augment the inherited code to provide more specific behaviour.