Concept: Paradigms
Reading Time: 2 minutes
Paradigm means organizing principle of a program. It is an approach to programming. The most common types of programming paradigm are:
Procedural Oriented Programming: The programming approach that focuses on the procedures for the solution of a problem is known as procedural-oriented programming paradigm. Languages that uses POP are: Fortran, C.
Object Oriented Programming: The programming approach that is organized around objects rather than actions and data rather than logic is known as object-oriented programming paradigm. Languages that uses OOP are: Java, Swift.
OO Programming Principles
Object Oriented Programming is based on four concepts:
Abstraction: Abstraction is the act of representing essential features without including the background details or explanations.
Encapsulation: Encapsulation is the way of combining both data and the functions that operate on the data into a single unit. Encapsulation is the way of implementing abstraction.
Inheritance: Inheritance is the capability of a class to inherit properties from another class. The class that inherits from other class is derived class and the other class is base class.
Polymorphism: Polymorphism is the ability for a message or data to be processed in more than one form. It is a property by which the several different objects respond in a different way to the same message.
Objects and Classes
In Java, object-oriented concepts are implemented using objects and class.
Object: Object is an identifiable entity with some characteristics and behaviour. It represents an entity that can store data and its associated functions. Objects are instances of class.
Class: A class is a group of objects that share common properties and relationships. It represents a blueprint of objects. Classes are user defined data types.
Java Runtime
The Java Virtual Machine is an abstract machine which is implemented on the top of existing processors. It hides the underlying operating system from Java applications. Programs written in Java are compiled into Java Byte Code, which is then interpreted by a special Java Interpreter for a specific platform.