-
Notifications
You must be signed in to change notification settings - Fork 0
(计算机)Method Signature
Chen Xiaojie edited this page Dec 18, 2022
·
1 revision
**Method Signature **或 Function Signature 意思相似。Java 使用 Method Signature 区分 Method,该区分用于 Overloading (重载) 。在python的PEP 362,提到希望使用 Function Signature 进行更高效的 introspection (内省) 。
下面是一段Method代码:
public double calculateAnswer(double wingSpan, int numberOfEngines,
double length, double grossTons) {
//do the calculation here
}这段代码对应的Method Signature是:
calculateAnswer(double, int, double, double)示例代码:
func()
func(x int) int
func(a, _ int, z float32) bool
func(a, b int, z float32) (bool)
func(prefix string, values ...int)
func(a, b int, z float64, opt ...interface{}) (success bool)
func(int, int, float64) (float64, *[]int)
func(n int) func(p *T)