Introduction Flashcards

1
Q

OOP:

what it does unlike procedural:

A

OOP treats data as a critical element in the program
development and
does not allow it to flow freely around the system.
It ties data more closely to the
functions that operate on it, and protects it from accidental modification from outside functions.
OOP
allows decomposition of a problem into a number of entities called objects and then builds data and
functions around these objects.

The data of an object can be accessed only by the functions associated with
that object. However, functions of one object can access the functions of other objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Some of the striking features of object-oriented programming are:

A

Emphasis is on data rather than procedure.
• Programs are divided into what are known as objects.
• Data structures are designed such that they characterize the objects.
• Functions that operate on the data of an object are tied together in the data struc ture.
• Data is hidden and cannot be accessed by external functions.
• Objects may communicate with each other through functions.
• New data and functions can be easily added whenever necessary.
• Follows bottom-up approach in program design.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Definition Of Object oriented paradigm:

A

“object-oriented programming as
an approach that provides a way of modularizing programs by creating partitioned memory area for
both data and functions that can be used as templates for creating copies of such modules on
demand.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

concepts used extensively in object-oriented programming.

These include:

A
  • Objects
  • Classes
  • Data abstraction and encapsulation
  • Inheritance
  • Polymorphism
  • Dynamic binding
  • Message passing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Objects:

A
  1. Programming problem is analyzed in
    terms of objects and the nature of communication between them.
  2. Chosen such that match with real world objects.
  3. Objects are the basic run-time entities in an object-oriented system.
  4. Objects take up space in the memory and
    have an associated address like a structure in C.
  5. When a program is executed, the objects interact by sending messages to one another.
  6. Each object contains data, and code to manipulate it.
  7. Objects can interact without having to know details of each other’s data or
    code. It is sufficient to know the type of message accepted, and the type of response returned by the
    objects.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Classes:

A
  1. Objects contain data, and code to manipulate that data. The entire set of
    data and code of an object can be made a user-defined data type with the help of a class.
  2. Object are variable of type class.
  3. After defining a class, we can create any number of objects belonging to that class.
  4. A class is thus a collection of objects of similar type
  5. Classes are user-defined data types and behave
    like the built-in types of a programming language.
  6. The syntax used to create an object is no
    different than the syntax used to create an integer object in C. If fruit has been defined as a class,
    then the statement
    fruit mango;
    will create an object mango belonging to the class fruit.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Encapsulation

data hiding/information hiding?

A
  1. The wrapping up of data and functions into a single unit (called class) is known as encapsulation.
  2. The data is not accessible to the outside
    world, and only those functions which are wrapped in the class can access it.
  3. These functions provide the interface between the object’s data and the program.
  4. This insulation of the data from direct
    access by the program is called data hiding or information hiding.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Data Abstraction :

data members and methods/member functions:

ADT?

A
  1. Abstraction refers to the act of representing essential features without including the background
    details or explanations.
  2. Classes use the concept of abstraction and are defined as a list of abstract
    attributes such as size, weight and cost, and functions to operate on these attributes.
    3.They encapsulate all the essential properties of the objects that are to be created.
  3. The attributes are sometimes
    called data members because they hold information. The functions that operate on these data are
    sometimes called methods or member functions.
  4. Since the classes use the concept of data abstraction, they are known as Abstract Data Types
    (ADT).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Inheritance:

principle?

A
  1. Inheritance is the process by which objects of one class acquire the properties of objects of another
    class.
  2. It supports the concept of hierarchical classification.
  3. The principle behind this sort of division
    is that each derived class shares common characteristics with the class from which it is derived.
  4. This concept provides the idea of reusability.
  5. This means that we can add
    additional features to an existing class without modifying it.
  6. New class will have combined features of both classes.
  7. Most imp is that a programmer can reuse and tailor the class in such a way that it does not introduce any undesirable side-effects into the rest of the classes.
  8. Note that each sub-class defines only those features that are unique to it. Without the use of
    classification, each class would have to explicitly include all of its features.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Polymorphism:

Object overloading?

A
  1. Term in greek means many forms.
  2. An operation may exhibit different behaviors in different instances.
  3. The
    behavior depends upon the types of data used in the operation.
  4. The process of making an operator to
    exhibit different behaviors in different instances is known as operator overloading.
    5.Polymorphism plays an important role in allowing objects having different internal structures to
    share the same external interface.
  5. This means that a general class of operations may be accessed
    in the same manner even though specific actions associated with each operation may differ.
  6. Polymorphism is extensively used in implementing inheritance.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Dynamic Binding

A
  1. Binding refers to the linking of a procedure call to the code to be executed in response to the call.
  2. Dynamic binding (also known as late binding) means that the code associated with a given procedure
    call is not known until the time of the call at run-time. It is associated with polymorphism and inheritance.
  3. A function call associated with a polymorphic reference depends on the dynamic type of that
    reference.
  4. At run-time, the code matching the object under current reference will
    be called.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly