RSS
Логотип
Баннер в шапке 1
Баннер в шапке 2
2010/05/25 14:23:05

Signature

Signature - in object-oriented programming languages set like a returned value, a name and the type list of function parameters (method). The signature always unambiguously operedelyat function (method) in a class.

Examples

<source lang="java"> class Foo {

public boolean test() { return true; }

public boolean test( int i ) { return i==1 ? true : false; }

public static void main() { System.out.println( "test : " + test() ); System.out.println( "test(2) : " + test( 2 ) ); }

} </source>

Result of accomplishment: test : true test(2) : false

Here two test methods with identical type of a returned value, but parameter lists at them different are defined. At the runtime by the parameter list it will be determined that in the first line of the main method () it is necessary to call the test method () without parameters, and in the second - with parameter.