Answers for "is there any ways to make arguments are optional in java"

0

java how to make a parameter optional

void foo(String a, Integer b, Integer c) {
    b = b != null ? b : 0;
    c = c != null ? c : 0;
    //...
}

foo("a", null, 2);
Posted by: Guest on July-16-2020

Code answers related to "is there any ways to make arguments are optional in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language