Methods With Same Name as Constructor - Why?

后端 未结 7 858
终归单人心
终归单人心 2020-12-01 16:09

Why is the following allowed:

public class Foo {
  public Foo() { ... }
  public void Foo() { ... }
}

Is there ever a valid reason for nami

7条回答
提交回复
热议问题