---
title: "Discussion on \"Deep Dive into Polymorphism in Java\" | Hashnode"
description: "Discussion on \"Deep Dive into Polymorphism in Java\". In Java, Polymorphism is a prevalent concept of Object Oriented Programming. Let's take a closer look at how polymorphism works in Java."
url: "https://hashnode.com/posts/deep-dive-into-polymorphism-in-java/636a020f7dc471f724ad3985"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Deep Dive into Polymorphism in Java](https://ishitaghosh.hashnode.dev/deep-dive-into-polymorphism-in-java?utm_source=hashnode&utm_medium=feed)

In Java, Polymorphism is a prevalent concept of Object Oriented Programming. Let's take a closer look at how polymorphism works in Java.

Nov 8, 2022 · 6 min read · ishitaghosh.hashnode.dev  
Updated Nov 10, 2022  
Read the article

-   [#2articles1week](https://hashnode.com/tag/2articles1week)
-   [#polymorphism](https://hashnode.com/tag/polymorphism)
-   [#java](https://hashnode.com/tag/java)
-   [#object-oriented-programming](https://hashnode.com/tag/object-oriented-programming)
-   [#basics](https://hashnode.com/tag/basics)

## Written by

[Ishita Ghosh](https://hashnode.com/@IshitaGhosh)

@IshitaGhosh · India

  
[View profile](https://hashnode.com/@IshitaGhosh)

Software Developer

## Responses 1

Markdown supported · ⌘↵ to post

[Shai Almog](https://hashnode.com/@talktotheduck)

[Nov 9, 2022](https://hashnode.com/posts/deep-dive-into-polymorphism-in-java/636a020f7dc471f724ad3985/comment/636b9bb64c5666f6e4c174e8)

Sorry but Java doesn't have operator overloading. That's builtin operator behavior.

Method overloading isn't a feature of polymorphism. It's a separate feature. Polymorphism is a trait of an object where it can appear as a single base type but can have a completely different implementation in a subclass. E.g.

```
public void method(List<String> list) {
   //...
}

method(myArrayList);
method(List.of("A", "B", "C");
```

Notice that `method` accepts two different object types both of which implement the `List` interface. Yet treats them as the same type due to inherited traits. That's polymorphism. It's always in runtime.

`ArrayList` will define the method `get` so the compiler must define it as a virtual call. That means that runtime needs to invoke the right implementation of that method.

[Ishita Ghosh](https://hashnode.com/@IshitaGhosh)

[Nov 10, 2022](https://hashnode.com/posts/deep-dive-into-polymorphism-in-java/636a020f7dc471f724ad3985/comment/636b9bb64c5666f6e4c174e8#reply-636c8422475684ff3259b716)

Thanks for taking the time to consider reading this article. I will definitely make the improvements you mentioned and try to learn more about this. Thanks for guiding.
