---
title: "Comment by Shai Almog on \"Deep Dive into Polymorphism in Java\" | Hashnode"
description: "Sorry but Java doesn&#39;t have operator overloading. That&#39;s builtin operator behavior. Method overloading isn&#39;t a feature of polymorphism. It&#39;s a s"
url: "https://hashnode.com/posts/deep-dive-into-polymorphism-in-java/636a020f7dc471f724ad3985/comment/636b9bb64c5666f6e4c174e8"
---

[Discussion](https://hashnode.com/posts/deep-dive-into-polymorphism-in-java/636a020f7dc471f724ad3985)

Comment [Deep Dive into Polymorphism in Java](https://hashnode.com/posts/deep-dive-into-polymorphism-in-java/636a020f7dc471f724ad3985)

[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.
