Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 690 Bytes

Method signature.md

File metadata and controls

9 lines (6 loc) · 690 Bytes

Method signature

Two of the components of a method declaration comprise the method signature - the method's name and the parameter types. The reason for the emphasis on just the method name and parameter list is because of overloading. It's the ability to write methods that have the same name but accept different parameters.

The compiler does not consider return type when differentiating methods, so you cannot declare two methods with the same signature even if they have a different return type.

Links

https://docs.oracle.com/javase/tutorial/java/javaOO/methods.html
http://www.java2s.com/Tutorials/Java/OCA_Java_SE_8_Method_Class/0030__Java_Method_Signature.htm