Android function
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 solution above doesn’t work, how can I do it?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, Java does not support default values for function parameteres. There’s an interesting post about borrowing language features here: http://java.dzone.com/news/default-argument-values-java