Polymorphism and Dynamic Binding in Java

Polymorphism is an Object-Oriented-Programming concept. Whether you are new to Java programming or a person who has worked with Java for years, you should know what polymorphism is in Java and how it works. Most developers claim that they know the topic well but when it comes to other complex features like static and dynamic binding, they seem underconfident. A good understanding of polymorphism allows us to build efficient object-oriented programs.

What Is Polymorphism in Java?

Polymorphism is composed of two words:        

Polymorphism, Encapsulation, Data Abstraction and Inheritance in Object-Oriented Programming

Object-Oriented programming refers to the concept in high-level languages, such as Java and Python that uses Objects and classes in their implementations. OOP has four major building blocks which are, Polymorphism, Encapsulation, Abstraction, and Inheritance. There are other programming paradigms, such as Procedural programming in which code is written sequentially.

Python and Java are multi-paradigm high-level, programming languages. This means they support both OOP and procedural programming. A programmer decides on the paradigm to use based on their expertise and the problems they're trying to solve. However, there is no debate that OOP makes programming easier, faster, more dynamic, and secure. This is a major reason Java and Python are two fo the top most popular programming languages in the world today

What Are the Differences Between Interfaces and Abstract Classes in 2021?

What you are reading is the fifth in a series of articles titled "Stranger things in Java", inspired by the contents of my book "Java for Aliens". These articles are dedicated to insights into the Java language. Better understanding the topics we use every day will allow us to master Java coding in even the most difficult scenarios.

The definitions for abstract class and interface have evolved since version 8 of Java, and knowing how the two now differ and interact is crucial. An understanding of their key differences will help users best work with these tools to leverage their full potential. 

OOP in Java: Polymorphism and Interfaces

As a senior member of my organization, I have to take interviews on regular basis as part of the recruitment process of our company. As an interviewer, I have witnessed some interesting observations about Java and the knowledge of individual interviewees. The experience ranges of the interviewees vary from around three to eight years.

In many cases, my observation is that the candidate knows the topic very well. Their theoretical knowledge is very good. And their answer quality shows that they have had hands-on work experience in different areas of core Java, like exception handling, the collections framework, generics, and objects. They have a more or less clear idea of what those things are. And in many cases, they are aware of new features added in more recent versions.