Given this class and the overloaded method:
public class MyClass {
public MyClass(){}
public String foo(string a, boolean b) { return "bool: " + i; }
public String foo(string a, String... values) { return "strarray: " + values; }
}
We want to call foo with the second parameter. We tried many iterations with type hints but I still can't get it to call the strarray method.
This is the array we get when we try into-array:
IllegalArgumentException No matching method found: setParam for class xxx clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:53)
How would one do this in clojure?
You can concate the string first and return the same
OUTPUT: strarray: ABCD PQRS XYZW