I have homework from collage. And i don't understand. About Java Polymorphism (overriding) really i don't understand. Can help everybody? And learn me more. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

I have homework from collage. And i don't understand. About Java Polymorphism (overriding) really i don't understand. Can help everybody? And learn me more.

20th Nov 2016, 1:00 PM
Sekar Amalia
Sekar Amalia - avatar
3 Answers
+ 6
Polymorphism is a long word for a very simple concept. Polymorphism describes a pattern in object oriented programming in which classes have different functionality while sharing a common interface. The beauty of polymorphism is that the code working with the different classes does not need to know which class it is using since they’re all used the same way. A real world analogy for polymorphism is a button. Everyone knows how to use a button: you simply apply pressure to it. What a button “does,” however, depends on what it is connected to and the context in which it is used — but the result does not affect how it is used. If your boss tells you to press a button, you already have all the information needed to perform the task. In the programming world, polymorphism is used to make applications more modular and extensible. Instead of messy conditional statements describing different courses of action, you create interchangeable objects that you select based on your needs. That is the basic goal of polymorphism.
20th Nov 2016, 1:19 PM
Aditya kumar pandey
Aditya kumar pandey - avatar
+ 3
here is an example that you may want to check to see difference or understand the meanings of overriding and overloading https://code.sololearn.com/c0awDMpDLukF/?ref=app
11th Sep 2017, 3:04 PM
Melih Melik Sonmez
Melih Melik Sonmez - avatar
+ 2
You have whatsapp or anything? I need really help and send pic of my program.
20th Nov 2016, 1:13 PM
Sekar Amalia
Sekar Amalia - avatar