Skip to main content

What is Object, Class and Inheritance in OOP (Definition)

What is Object, Class and Inheritance in OOP (Definition)

Object, Class, and Inheritance are the main characteristics of Object-Oriented programs. Here is the definition of object, class, and inheritance...

Object

The object is a concept with defined boundaries that are the same as the problem we are working with. Its main purpose is to understand the real world and to provide a practical basis for a computer application. When we approach a programming problem in an object-oriented language, the problem is divided into different objects. An object includes data and functions, functions are used to perform the operations on data. The data containing the object is called member data and the function is a member function. It provides data security. The basic concept of object-oriented programming is to combine into a single unit, both the data and its functions. An object is an instance of a class. It can be uniquely identified by its name and it defines a state which is represented by the values of its attributes at a particular time or is an individual unit of run-time data storage. Every object is capable of receiving messages, data and sending messages to other objects.

Class

A class is a collection or group of similar objects that have the same properties, common behavior, and relationships. Objects with similar properties and actions need to be grouped together into a unit that can be used in a program. Each class describes a set of individual objects. The concept of class leads to the reusability of programming code. A code is written in an object of the class that can be reused by another object of the class. This concept helps to decrease the length of programming code. A class describes a collection of encapsulated instance variables and methods, possibly with the implementation of those types together with a constructor function that can be used to create objects of the class.

Inheritance

Inheritance is the property that allows the reuse of an existing class to build a new class. The principle in this sort of division is that each subclass shares the same properties with the class from which it is derived. For example, all vehicles in a class may share the properties of having wheels and a motor. Inheritance is a way to form new classes. The new classes are known as derived classes. Base classes are referred to help reuse existing code with little reduction. There are four types of Inheritance. They are:
  • Single Inheritance
  • Multiple Inheritance
  • Hierarchy Inheritance
  • Multilevel Inheritance
These are the three characteristics of OOP which are Object, Class, and Inheritance.

Comments

Popular posts from this blog

What is Kite Flying? - Definition

Kite-Flying is a popular game. It is played in the autumn season. This season is fit for kite-flying, for it is neither much cold nor much hot. The harvesting season is over, and people have plenty of time at their disposal. Boys are very fond of kite-flying. Even grow-up men take part in it. The kite-flying season lasts two months. The kite is made of a square piece of paper. The paper is white or colored. there are two sticks pasted on this paper. One stick is straight and the other is curved. The straight stick is placed diagonally. The curved stick is placed nearly at the top of the straight stick, its ends touching two corners of the paper. The straight stick is tied with a piece of thread at two points just below its ends. This thread is joined to a long thread wound on a reel. The kite-flier holds the reel with his hands. He needs a helper for flying the kite. The helper catches the kite with his hand and goes to a long distance. He throws the kite up, and the flier pulls

What is LAN and WAN Networks? - Definition

LAN and WAN are the two types of computer network on the basis of geographical area coverage. Both are different from each other. Here is the definition of both networks. LAN (Local Area Network) The interconnection within room or building is known as LAN (Local Area Network). The data transmission rate is faster than WAN. Most of the LAN is built with relatively cheap hard drives like Ethernet cables, network adapters, and hubs. LAN has higher security to resources of the network. It is more easy to manage and operate. It can operate at a speed of 100mbps. There is lack of backup compares to WAN in LAN. It is only limited for short distance. The network structures of LAN is in Homogenous form. WAN (Wide Area Networking) The interconnection within a country or between neighbor countries and within a continent is known as WAN (Wide Area Networking). The data transmission rate is slower than the LAN. WAN use much expensive software than LAN. It helps to send data/information

What do you mean by Bounded media and Unbounded media? (Definition)

Bounded and unbounded media are the transmission media which is used to transfer data from one destination to another through its means. Bounded Media The transmission media which uses to transmit the signal/data/information from one to another is known as bounded media. The data transmit rate is faster than the unbounded media. Bounded media is used to transmit data/information in short distance. It uses twisted pair cable, coaxial cable, and fiber optic cable as transmission media. All the computer and devices are physically connected in bounded media. Unbounded media The transmission media which uses wireless to transmit data/information/signal from one to another is known as unbounded media. The data transmit rate is slower than the bounded media. It is used for transmitting the data/signal/information for long-distance. It uses radio wave/microwave/communication satellite as transmission media. All the computer and devices aren't physically connected. Bounded m