How can i put elements into the following string array?
String[] myString = new String[] {};
Note: Number of element is not fixed.
How can i put elements into the following string array?
String[] myString = new String[] {};
Note: Number of element is not fixed.
You cannot.
Since myString
is an empty array and since an array's length is fixed, an empty array cannot be changed.
But what you can do is to store a new, different array in the myString
variable.