oops-concepts

[object Object]
Introduction to Constructor in Java

In object oriented programming, we may want our object to get initialized with some specific properties, or we may need to do some operations every time an object is instantiated. To do such things, we use constructors. In simple words, a constructor is defined inside the class that contains the code to instantiate the object of a class in java.

[object Object]
Operator Overloading in C++

Operator overloading is a compile time polymorphism that allows us to extend the meaning of an operator to operate on a user-defined data type. The main advantage of operator overloading is that we can have different implementations of an operator based on the argument type. Here we will learn how to implement and overload various operators.

[object Object]
Inheritance in Object Oriented Programming (OOPS)

Inheritance is one of the core principles of object oriented programming (OOP), which helps us derive a class from another class or a hierarchy of classes that share a set of attributes and methods. It is a relationship between a superclass (parent class) and a subclass (child class), where subclass inherits data and behavior from superclass.

[object Object]
Abstraction in Object Oriented Programming (OOPS)

Abstraction is a process of exposing necessary functionality to external objects and hiding implementation details. This helps programmers to use complex logic without understanding its implementation. So one needs to know what code does, not how it does it. There are two types of abstraction in oop: data abstraction and control abstraction.

[object Object]
Encapsulation in Object Oriented Programming (OOPS)

In OOPS, Encapsulation is one of the basic concepts that bundles data and methods into a single block called class. It is a pathway for restricting direct access to some data and methods (which leads to data hiding). In other words: Encapsulation is about wrapping data and methods into a single class and protecting it from outside intervention.

[object Object]
OOPS Concepts in Java

Learning oops is essential for modern software development as it introduces features like inheritance, encapsulation, abstraction, and polymorphism. Besides reducing code complexity, oops provide advantages like modularity, reusability, extensibility, data hiding, etc. This blog has covered a fundamental overview of oops concepts in java.

[object Object]
Principles of Object Oriented Programming (OOPS)

Abstraction, Encapsulation, Inheritance, and Polymorphism are four fundamental principles of object oriented programming. These oops principles provide advantages like modularity, code reusability, feature extensibility, data hiding, etc. In this blog, we will learn how the four main oop principles work together to make a well-designed application.

[object Object]
Why do we need to learn OOPS?

Modern software usually consists of millions of lines of code and operates on terabytes of data. So we need a way to organize a large code base to make it easier to understand, explain, reuse, extend and maintain. That's why we need object oriented programming (OOP). It has been one of the most important paradigms used in the last few decades.

[object Object]
Introduction to OOPS in Python Programming

In Python, everything is an object which holds different properties and methods. Class is a blueprint that creates these objects. In this blog, we have explained fundamental oops concepts in python: 1) What are classes and objects? 2) How to use classes and objects? 3) Default classes examples in python 4) Abstraction, Inheritance and Polymorphism.

[object Object]
Abstract Class in Java

In Java, abstraction is implemented using abstract class and interface. An abstract class is similar to any other class declared with the abstract keyword, and one can never instantiate an abstract class. Here we have discussed: 1) What is abstract class? 2) Why do we need abstract classes? 3) Abstract Methods 4) How to extend abstract class?

[object Object]
Interface in OOPS (Java)

The word interface means a medium or means of communication between two entities. Similarly, in object oriented programming, interfaces are used to ease the communication between classes and objects. An interface in java looks similar to class and contains only constants, method signatures, default methods, and static methods.

[object Object]
Exception Handling in Java

Exception handling is one of the most important features of java programming that allows us to handle runtime errors caused by exceptions. An exception is an event that occurs during the execution of a program and disrupts the expected flow of the program. In this blog, we will learn exception types, classes and how to handle exceptions in java with examples.

[object Object]
Compile-time vs Runtime Polymorphism in Java

In OOP, Polymorphism allows us to code to an interface and has multiple implementations, making the code better. There are two types of polymorphism in java: compile-time and runtime. The compile time polymorphism is implemented using method overloading, and runtime polymorphism is implemented via method overriding.

[object Object]
Class vs Structure in C++

Classes and structures are fundamental building blocks of object oriented programming C++. Although classes and structures have the same type of functionality, there are a few differences between them based on their definition and use cases. The data members of a class are private by default and the members of a structure are public by default.

[object Object]
Dependency Inversion Principle (DIP)

The Dependency Inversion Principle (DIP) in software engineering states that high-level modules should not depend on low-level modules. In other words, both should depend on abstractions. This abstraction removes the direct dependency on the details, decouples them and allows for easier reuse of the important functionality in the policy.

[object Object]
Method Overloading in OOPS (Java)

Java language has a method overloading feature, which allows multiple methods within a class to have the same name with different argument lists. This is a type of polymorphism (the process by which we can perform a single task in various ways). To be more concise, method overloading is an example of static polymorphism.

[object Object]
Interface Segregation Principle (ISP)

The Interface Segregation Principle states that clients should never be forced to depend on methods they do not use. We achieve this by making small and focused interfaces. It would be best to split large interfaces into specific ones focused on a particular set of functionalities so that clients can choose to depend only on functionalities they need.

[object Object]
Classes and Objets in OOPS

Classes and objects are fundamental building blocks of object oriented programming (OOP). A class is a user-defined blueprint that describes what a specific kind of object will look like, but object is an instance of a class which contains data and associated methods working on that data. Memory is allocated when a class is instantiated.

[object Object]
Singleton Design Pattern

Some objects might be common to all parts of the program, and we require a single instance of it. Singleton is a creational design pattern that ensures that a class has only one instance throughout the application. This restricts the instantiation of a class to one object, which is accessible from any part of the application with global access.

[object Object]
Fundamentals of OOPS Concepts in C++

Object-oriented programming (OOP) is a widely-used programming paradigm in many modern programming languages, including C++. It is based on the concept of object and class. OOP in C++ also supports several key concepts such as encapsulation, inheritance, and polymorphism that help to structure and organize code for large-scale software development, making it more efficient, modular maintainable, and reusable.

[object Object]
Liskov Substitution Principle (LSP)

According to the Liskov Substitution principle, an object of a parent/base class must be interchangeable with an object of a child/derived class without changing the program. So the subclass objects should behave in the same way as the superclass objects. In simple words, LSP is all about well-designed inheritance.

[object Object]
Factory Method Design Pattern

The factory method design pattern is a creational design pattern in which we define a superclass for creating an object but let the subclasses decide which class to instantiate. Therefore, the factory method enables a class to delegate instantiation to its subclasses and eliminates the coupling of concrete products to the client code.

[object Object]
Open Closed Principle (OCP)

In object oriented programming, open closed principle states that: software entities (classes, modules, etc.) should be open for extension but closed for modification i.e. such an entity can extend its behavior without modifying its source code. This principle allows us to use the power of abstraction and inheritance to create such systems.

[object Object]
Popular Software Engineering Principles

Principle of software engineering are recommendations for developers to follow during software development. They are good practices for writing extensible, modular, reusable, and maintainable code. Some popular principles of software engineering are Separation of Concerns, Law of Demeter, KISS principle, YAGNI Principle, SOLID Principles, etc.

[object Object]
Single Responsibility Principle (SRP)

The single responsibility principle is one of the popular SOLID principles in software engineering that determines how we should modularize code in object-oriented programming. The idea for this principle is relatively simple: it makes our software easier to implement and prevents unexpected side effects of future changes.

[object Object]
Pointers and Memeory in C++ Programming

In this blog, we have discussed critical C++ programming concepts related to dangling pointers, bad pointers, memory leaks, static memory, dynamic memory, reference variable, const and volatile keywords, template, etc. We have also provided various code examples and scenarios of possible bugs to understand each concept in C++.

Our weekly newsletter

Subscribe to get weekly content on data structure and algorithms, machine learning, system design and oops.

© 2022 Code Algorithms Pvt. Ltd.

All rights reserved.