There's a String array that I have which has setter and getter methods. How do I directly pass values {"one", "two"} to the setter method rather than setting the values to a variable first and then passing the parameter?
String[] arr1 = {};
public String[] getArr1() {
return arr1;
}
public void setArr1(String[] arr1) {
this.arr1 = arr1;
}
..expecting something like setArr1(?);...
setArr1(new String[]{"One", "Two"});is working fine!!