Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #parameter #optional
ADD COMMENT
Topic
Name
7+3 =