Sunday, June 15, 2014

Java - overloading

Over-Loading: define multiple methods with the same name, but with different parameters. 

 Functions in Java could be overloaded by two mechanisms :
  • Varying the number of arguments.
  • Varying the Data Type.

also defined  as different method signatures

can make code hard to read

overloading does not fully support polymorphism

overriding does though as its one type with different behaviors roughly

No comments:

Post a Comment