Object oriented programming

Vechicle class

Classes are a fundamental part of object-oriented programming. They allow variables and methods to be isolated to specific objects instead of being accessible by all parts of the program. This encapsulation of data protects each class from changes in other parts of the program. By using classes, developers can create structured programs with source code that can be easily modified.

The class is one of the defining ideas of object-oriented programming. Among the important ideas about classes are:

A class can have subclasses that can inherit all or some of the characteristics of the class. In relation to each subclass, the class becomes the superclass.

Subclasses can also define their own methods and variables that are not part of their superclass.

The structure of a class and its subclasses is called the class hierarchy.

Objects are pass by reference.

Principles of OOPs :

  1. Inheritance
  2. Encapsulation
  3. Polymorphism

Inheritance :


Encapsulation :

  • Everyone knows how to access it.
  • Can be easily used regardless of implementation details.
  • There shouldn’t any side effects of the code, to the rest of the application.

Polymorphism :

  • Overloading in simple words means two methods having same method name but takes different input parameters. This called static because, which method to be invoked will be decided at the time of compilation
  • Overriding means a derived class is implementing a method of its super class.

Data abstraction:

If you enjoyed reading this post, please share and recommend it so others can find it 💚💚💚💚💚💚 !!!!




iOS and tvOS developer, dreamer, photographer 🤨

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Setup Ethereum Mining in Linux

KEPLERSWAP’S LUCKY POOL LUCKY POOL is one of KeplerSwap’s creative innovations and a significant…

Java program to check If It Is an equilateral ,scalene or isosceles triangle.

A Prototype is not an MVP

Getting Ready for Future of Software Programming

Business Ideas #2

Windows 7 64 Torrent

How to Troubleshoot and Fix a Frozen Mac System

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


iOS and tvOS developer, dreamer, photographer 🤨

More from Medium

How to write your first function in C — main(); printf();

Hunk in Git

Creating and Using Dynamic Libraries in C language

Creating a game to refine my C# skills - 1