Ch-6 Object Oriented Concept

Object-oriented programming concepts started originating in the 1960s.
It was developed as a way to handle the rapidly increasing size and complexity of software systems and to make it easier to modify these large and complex systems over time.

Some of the popular programming languages that support object-oriented programming are CH, Java, C#, VB.net, AŞP.net and PHP.

Object-oriented techniques as methodology or as paradigmisplayingsignificant roleinanalysis, designandimplementationofsoftware system.

In object-oriented programming, attributes that describe the object are also referred to as data fields.

The data attributes and behavioral methods associated with an object are collectively referred to as its members or features.

Class :- Object-oriented system uses the concept of class that enables to express the set of objects that are abstractly equivalent, differing only in the values of their attributes. Class can be considered as a blueprint for various objects.

Encapsulation :-This mechanism of providing protection to data and methods of a program is called encapsulation. Encapsulation keeps the data safe from unintended actions and inadvertent access by outside objects. object-oriented programming discourages direct access to common data.

Data Abstraction :- Data abstraction is a process of representing the essential features of the objects without including implementation detail. Abstraction is a concept that bides the complexity; it says what it does, but not how it is done.

Polymorphism :- Polymorphism means ‘many forms’. There may be different forms of single method or operation.
Object-oriented programming allows defining more than one method having same name but different signatures in a single class. This feature is known as function or method overloading.
This type of polymorphism is achieved through operator overloading. Thus, polymorphism is achieved using two types of overloading: function overloading and operator overloading. In general, the capability of using same names to mean different things in different contexts is called overloading. Aggregation and Composition

Inheritance :- Inheritance is generally referred to as ‘is-a-kind-of relationship between two classes. It is appropriate when one class is ‘a kind of other class. For example, teacher is a kind of person.

Inheritance refers to the capability of defining a new class of objects that inherits the characteristics of another existing class. In object-oriented terminology, new class is called sub class or child class or derived class; whereas the existing class is called super class or parent class or base class.

Multiple Choice Answer

(1) In Object-oriented methodology, the focus is on which of the following entities?
(a) Data
(b) Functions
(c) Objects
(d) All of the above

(2) Which of the following best suits to Java ?
(a) A procedural programming language
(b) An Object-oriented programming language
(c) A Query language
(d) All of the above

(3) Which of the following is used to distinguish objects from each other ?
(a) Attributes
(b) State
(c) Behavior
(d) All of the above

(4) Which of the following is used to define common features of similar objects ?
(a) Class
(b) Object
(c) Methods
(d) All of the above

(5) Which of the following is not a visibility symbol ?
(a)`
(b) *
(c) #
(d) – O

(6)Which of the following is provided using encapsulation ?
(a) Data protection
(b) Data sharing
(c) Separation of data and methods
(d) All of these

(7)Which of the following is enabled by data abstraction ?
(a) Data protection
(b) Data hiding
(c) To hide implementation details of method manipulating the data
(d) All of these

(8) With which of the following options polymorphism cannot be achieved ?
(a) Method overloading
(b) Operator overloading
(c) Data hiding
(d) All of these

(9) An aggregation model refers to which of the following relationships ?
(a) ‘is-a’ relationship
(b) ‘is-like’ relationship
(c) ‘a-part-of relationship
(d) All of these

(10) An inheritance model refers to which of the following relationships ?
(a) ‘is-a’ relationship
(b) has-a’ relationship
(c) ‘a-part-of relationship
(d) All of these

(11) In class diagram, composition is represented using which of the following symbols ?
(a) Empty diamond symbol
(b)Filled diamond symbol
(c) Empty triangle symbol
(d) All of these