tutorial, no_image, java,

Java - no_image

Upendra Upendra Follow Jan 23, 2025 · 1 min read
Java - no_image
Share this

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.

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

credit goes to @swayangjit
Join Newsletter
Get the latest news right in your inbox. We never spam!
Upendra
Written by Upendra Follow
Hi, I am Upendra, the author in Human and machine languages,I don't know to how 3 liner bio works so just Connect with me on social sites you will get to know me better.