Type signature

the the the

Type_signature

Java方法簽名

在Java程式語言,一個方法簽名的方法名稱和參數的數量和類型。返回類型和拋出異常並不認為是一個方法簽名的一部分。
methodName(parameters){...};
例如,下面的兩種方法有不同的簽名:
doSomething(inty);
doSomething(Stringy);
以下三種方法有相同的簽名被認為是相同的,只是返回值不同。參數的名稱不是方法簽名的一部分,忽略編譯器檢驗方法唯一性。
(原話如下本人英語不好,如果有翻譯不對的地方請幫忙改正,謝謝。)
【Thefollowingthreemethodsdohavethesamesignaturesandareconsideredthesame,asonlythereturnvaluediffers.Thenameoftheparameterisnotpartofthemethodsignatureandisignoredbythecompilerforcheckingmethoduniqueness.】
intdoSomething(inty);
StringdoSomething(intx);
intdoSomething(intz)throwsjava.lang.Exception;

相關詞條

熱門詞條

聯絡我們