Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to add elements in string array in java

Arrays in Java have a defined size, you cannot change it later by adding or removing elements (you can read some basics here). Instead, use a List : ArrayList<String> mylist = new ArrayList<String>(); mylist. add(mystring); //this adds an element to the list.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #elements #string #array #java
ADD COMMENT
Topic
Name
9+5 =