Polymorphism in java | Runtime and compile time Polymorphism | Overloading | Overriding | Java Code

Publicado el: 13 mayo 2023
en el canal de: Tech Fusion ai | Java Tutorials | Java DSA
19
2

Polymorphism is a fundamental concept in object-oriented programming, and it refers to the ability of an object to take on many forms. In Java, there are two types of polymorphism: compile-time polymorphism and runtime polymorphism.

1. Compile-time polymorphism: also known as static polymorphism, is achieved through method overloading. Method overloading allows you to define multiple methods with the same name but different parameters, and the appropriate method is called based on the type and number of arguments passed to it.

2. Runtime polymorphism: also known as dynamic polymorphism, is achieved through method overriding. Method overriding allows a subclass to provide a different implementation of a method that is already defined in its superclass.

In summary, polymorphism is a powerful concept in Java that allows objects to take on many forms. It enables you to write code that is more flexible, reusable, and easier to maintain.


En esta página del sitio puede ver el video en línea Polymorphism in java | Runtime and compile time Polymorphism | Overloading | Overriding | Java Code de Duración hora minuto segunda en buena calidad , que subió el usuario Tech Fusion ai | Java Tutorials | Java DSA 13 mayo 2023, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 19 veces y le gustó 2 a los espectadores. Disfruta viendo!