private void MyParameterizedFunction(String param1, int param2, Boolean... params) { assert params.length <= 1; boolean param3 = params.length > 0 ? params[0].booleanValue() : false; } private void test() { MyParameterizedFunction("", 1); }
Reference: