Java - Class Method Signature

Introduction

Examples of Method's Declarations and Their Signatures

Method DeclarationMethod Signature
int add(int n1, int n2) add(int, int)
int add(int n3, int n4) add(int, int)
public int add(int n1, int n2)add(int, int)
public int add(int n1, int n2) throws OutofRangeException add(int, int)
void add(int n) add(int)
double add(int n1, double d1) add(int, double)
double add(double d1, int n1) add(double, int)

The signature of a method uniquely identifies the method within a class.

You cannot have more than one method in a class with the same signature.

Related Topic