Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

add value with n variable with Arraylist in java

Scanner in = new Scanner(System.in);
int n = 5;
ArrayList<String> addName = new ArrayList<>();
for(int i = 0; i < n; i++){
  addName.add(in.nextLine());
}
 
PREVIOUS NEXT
Tagged: #add #variable #Arraylist #java
ADD COMMENT
Topic
Name
4+7 =