Is it possible to declare default argument in Java in String?
This question already has an answer here:
不,你通常会这样做的方式是重载方法,如下所示:
public void test()
{
test("exampleText");
}
public void test(String name)
{
}
No, it is not. However, the following is possible:
public void test() {
test("exampleText");
}
public void test(String name) {
//logic here
}
链接地址: http://www.djcxy.com/p/20864.html
上一篇: Java支持默认参数值吗?