OBJECT ORIENTED PROGRAMMING CONCEPT
Object-oriented programming is a type of programming based on Unified modeling language concepts in which programming is based on classes and objects. Programming in functional mode and procedural mode is a good option in ancient times but with Object oriented design, it is easy to design programs and make efficient solutions to problems using instances/objects.
OBJECT ORIENTED PROGRAMMING LANGUAGES
There are many object oriented programming languages including famous languages. The most commonly used languages are:
- Java
- Python
- C++
- Ruby
- C#
- Lisp
- Perl
- Go-Lang
Object oriented programming is a technique that defines into objects and classes. Using classes and objects, we can make instance of the each object and values of each instance are created without reference to other. On the other hand, procedural or imperative programming do not give you this type of functionality and you can not create objects for it. Object oriented programming has helped to develop big GUI systems and this all owes to Object oriented programming.
CONCEPTS OF CLASSES
A class is defined as a blueprint of object. A class is used to define object. A class defines properties and behaviors of objects. A class can be anything that has its identifier, properties and behaviors that may be Apple class that has its own identifier (Apple) and property like its shape, color, taste and behavior like it can grow with season etc.
Let's define three main properties of class in Object oriented programming, which are:
- A class always has its own identifier, means it should have its own unique name that is specified to it. Without a specific name, it can not be a class. Like Rectangle class has its own name Rectangle. Similarly, Apple class, Banana class, and many other class names you want to create depending on the requirement in object oriented programming.
- A class should have its own property. Likewise, class Apple has its property to shape, color etc. Property defines to specific attributes or members in object oriented programming implicitly. NOT only this member variables are the part of the class that define properties to class for specific instances. We will dive into it more in later articles.
- A class must have its own behavior. Likewise, a class Cat has its behavior of eating, moving etc. physically. In programming terms, a class should have its own methods that can specify its operations or behaviors during program.
DIFFERENCE BETWEEN IMPERATIVE AND PROCEDURAL PROGRAMMING
Imperative programming refers to code that is concerned with lower levels of abstraction. Procedural programming is a subset of imperative programming which utilizes subroutines. Functional programming is a subset of declarative programming which utilizes subroutines. (Original Source)
Don't think of comments for now. So far only you have to focus on class and its members. Also analyze
source code of Runner class below:
