I need to convert an ArrayList to a String array which is declared as final,
I ended up with this:
//new array
String[] arrTextRow=new String[customListTxt.size()];
customListTxt.toArray(arrTextRow);
//new final array
final String[] arrTextRow2=arrTextRow;
it's working, but just wondering if there is a more elegant way to achieve this, such as:
final String[] arrTextRow =new String[]{
for(String zz : customListTxt){
//dosomethinghere
}
};
arrTextRowfinal?