Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to add element in java arraylit syntax in gfg

Input:
list.add("A");
list.add("B");
list.add("C");
Output:
list=[A,B,C]

Input:
list.add(1);
list.add(2);
list.add(3);
list.add(4);
Output:
list=[1,2,3,4]
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #add #element #java #arraylit #syntax #gfg
ADD COMMENT
Topic
Name
6+2 =