Java – Android: how to set the default value of parameter variables

Android features

PHP example:

Function haha ($a = "test") {print $a;}

The question is how to do it in Android

public void someFunction(int ttt = 5)
{
   // something
}

The above solution doesn't work. What should I do?

thank you!

Solution

No, Java does not support default values for function parameters There is an interesting post about borrowing language features: http://java.dzone.com/news/default-argument-values-java

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>