Java for beginners - Chapter 20 : Polymorphism in java Part 1

preview_player
Показать описание
Polymorphism in Java:
Polymorphism is another important concept in OOPS.
Polymorphism is the ability to take more than one form.
How to achieve polymorphism in java :
Method Overloading.
Method Overriding.

Method Overloading :
If a class has many methods with same name, but differ in number of parameters is called method overloading.
Different ways to overload method :
By changing the number of arguments.
By changing the data type.

Method Overriding :
If child class has the same method as declared in the parent class, it is known as method overriding .
Different ways to override a method :
Method name and parameter must be same as in parent class.
It is possible only through inheritance.

Method Overriding :
Use of Super keyword in overriding :
If we wish to call parent class method also in child class then we have to use super keyword

ankpro
ankpro training
C#
C sharp
Bangalore
Rajajinagar
Selenium
Coded UI
Mobile automation testing
Mobile testing
JQuery
JavaScript
.Net
C
C++
Components of the .Net framework
Hello World
Literal
Keywords
Variable
Data types
Operators
Branching
Loops
Arrays
Strings
Structures
Enums
Functions
Рекомендации по теме
visit shbcf.ru