Encapsulation and Abstraction are two fundamental concepts in Object-Oriented Programming (OOP) that help to promote modularity, reusability, and maintainability in code. In this blog post, we will explore the differences between encapsulation and abstraction in Java, as well as the steps and commands required to implement them. Encapsulation refers to the practice of hiding the implementation…
Category: OOPS
Abstraction in Java explained with example.
Abstraction in Java is the process of hiding the implementation details and exposing only the necessary information to the user. It is one of the core concepts of object-oriented programming and is used to create a simplified version of an object or class, allowing the user to interact with it in a more intuitive and user-friendly…
Polymorphism in Java explained with example.
Polymorphism in Java is the ability of an object to take on multiple forms. This means that an object can be treated as an instance of its parent class or any of its subclasses. In other words, polymorphism allows a single interface to be used for different types of objects. One of the most common examples…
Inheritence in Java explained with example.
Inheritance is a fundamental concept in object-oriented programming, and it is supported in Java through the use of the “extends” keyword. This feature allows developers to create new classes that inherit properties and methods from existing classes, making it easier to reuse code and build more complex systems. For example, let’s say we have a superclass…
Encapsulation in Java explained with example.
Encapsulation is a fundamental concept in the world of object-oriented programming (OOP) and is widely used in Java. It is the process of hiding the internal details of an object from the outside world. This helps to protect the data and behavior of an object from being modified by external sources, and ensures that the object’s…
Objects and Classes in Java explained.
Objects and classes are two fundamental concepts in the world of object-oriented programming (OOP). Understanding the differences and similarities between these two concepts is essential for anyone working with Java, one of the most widely used programming languages that is fully object-oriented. In this blog post, we will discuss the concepts of objects and classes in…
What are the Object Oriented programming (OOPs) concepts in Java?
Object-Oriented Programming (OOP) is a programming paradigm that is based on the concept of “objects” which can contain data and methods that operate on that data. Java, one of the most widely used programming languages, is fully object-oriented and supports all the concepts of OOP. In this blog post, we will be discussing some of the…
Static import in Java
Static import allows you to access the static member of a class directly without using the fully qualified name. To understand this topic, you should have the knowledge of packages in Java. Static imports are used for saving your time by making you type less. If you hate to type same thing again and again then you…
Overloading vs Overriding in Java.
In this blogpost we will discuss the difference between overloading and overriding in Java. If you are new to these terms then refer the following posts: Overloading vs Overriding in Java Overloading happens at compile-time while Overriding happens at runtime: The binding of overloaded method call to its definition has happens at compile-time however binding of overridden method call…
Different Access modifiers in Java: private vs protected vs default vs public
There are two types of modifiers in Java: access modifiers and non-access modifiers. The access modifiers in Java specifies the accessibility or scope of a field, method, constructor, or class. We can change the access level of fields, constructors, methods, and class by applying the access modifier on it. There are four types of Java access modifiers: Private: The…