0% found this document useful (0 votes)
49 views

Oops

Object-oriented programming allows programmers to create objects that contain data fields and methods to interact independently based on functions called and data presented. A class acts as a template for creating objects by containing attributes, properties, and behaviors like methods. Inheritance gives a class the ability to use properties and methods of a generic superclass, so subclasses can make use of what is defined in the superclass. Polymorphism is a concept in object-oriented programming that allows subclasses to have different implementations of methods inherited from the same superclass.

Uploaded by

Madhu Gummadi
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

Oops

Object-oriented programming allows programmers to create objects that contain data fields and methods to interact independently based on functions called and data presented. A class acts as a template for creating objects by containing attributes, properties, and behaviors like methods. Inheritance gives a class the ability to use properties and methods of a generic superclass, so subclasses can make use of what is defined in the superclass. Polymorphism is a concept in object-oriented programming that allows subclasses to have different implementations of methods inherited from the same superclass.

Uploaded by

Madhu Gummadi
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

What is object-oriented programming?

In object-oriented programming the programmers are able to create objects which contain data fields, methods as well as instructions as to how these data fields and methods should interact. This allows the object to function independently and depending on the function calling the object and the data presented to it, it can perform a pre-determined action. The beauty of this would be, the flexibility given to the programmers in calling such objects from anywhere in the programme and not having to type the same code repeatedly. What is a class? In order to understand the terms inheritance and polymorphism, first we needs to know what is meant by a class. In simple terms, a class can be described as a blue print for a factory, which allows it to produce certain items. Thus, a class will act as a blue print or more specifically as a template for the creation of objects. Therefore, a class needs to contain attributes, fields, properties as well as the behaviors such as methods, operations and features. What is inheritance? When a class is given the ability to use properties and methods of another generic class, it is said to inherit the functionality of the generic class. For example, one can define a class containing properties, methods and other functionality generic to all patients of a hospital known as patient class and several more classes containing details pertaining to specific disease conditions of each patient such as class pneumonia, diabetes and hypertension. The class patient in this instance will be known as the super class whereas the other classes which are more specific will be known as sub classes. In OOP, subclasses can make use of the generic properties and the methods of the super class, which is the concept described by the term inheritance. What is polymorphism?

You might also like