Posts tagged "OOPs Concepts "

Tag Archives: OOPs Concepts

Exception Handling in Method Overriding

Let’s learn about Exception handling in Method overriding. There are few things to remember when overriding a method with exception handling. There are certain restrictions while overriding a method in case of exception handling in Java. Broadly there are two rules –   If the superclass method does not declare an exception If the superclass method does not declare … Continue reading Exception Handling in Method Overriding

Compile Time vs Run Time Polymorphism

Polymorphism is one thing in many forms or the capacity to take on different forms.  When it applied to object-oriented programming languages like Java, it describes the ability of language to process objects of various types and classes through a single, uniform interface. Polymorphism in Java is two types- Compile Time or Static Polymorphism Run Time of … Continue reading Compile Time vs Run Time Polymorphism

Abstract Class in Java

Let’s learn about the Abstract Class in Java. Abstraction in Java or Object oriented programming is a way to segregate implementation from interface. Abstraction in Java is achieved by using interface and abstract class in Java. Interface give 100% abstraction and abstract class give 0-100% abstraction. In order to use interface or abstract class, we need … Continue reading Abstract Class in Java

Encapsulation in Java with Real World Example

Encapsulation is the process of wrapping the data and functions together or hiding the data from the outer world. It is the idea to hide the implementation details from the user and avoid the direct access to the class members from the outer world. We can achieve the encapsulation in our class, by making the … Continue reading Encapsulation in Java with Real World Example

Aggregation and Composition in Java Example

Association is a relationship between two separate classes which can be of any type say one to one, one to may etc. It joins two entirely separate entities. Association further divides into two types – Aggregation Composition Aggregation and Composition both justify the concept of Association the only difference is Composition is more restrictive as compare the … Continue reading Aggregation and Composition in Java Example

OOPS Concepts in Java with Example

OOPs is a design philosophy. It stands for Object Oriented Programming system. Everything in OOPs is grouped as “objects“. Hence, OOPs provide the reusability by means of four main object-oriented programming concepts. In order to clearly understand the OOPs model, let’s take your “Eye” as an example. This “Eye” is a class. Your body has two … Continue reading OOPS Concepts in Java with Example