Answers for "put optional parameter 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 "put optional parameter java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language