I need to append a dynamic string value to a new string array with known values.
static final String [] ARRAY = {"A","B","C"};
String d = "D"; // could be changing dynamically.
My question is to append a value to a new string array with a dynamic string value.
I need something like this.
String [] EXPECTED_ARRAY = {ARRAY, d}; // does not compile.
Expected Output: (local String array)
String [] EXPECTED_ARRAY = {"A", "B", "C", d};
Thanks in advance. BTW: Arrays, ArrayList can do this easily. Is there any other alternative ways.