java - Create an ArrayList that can hold String objects -


... add names of 3 cars arraylist , display contents of arraylist..

this question in class, last one. please

i think need full code:

import java.util.arraylist;  public class arraylist_test {     public static void main(string[] args) {         arraylist<string> carnames = new arraylist<string>(3);         carnames.add("carname1");         carnames.add("carname2");         carnames.add("carname3");         (string carname : carnames) {             system.out.println(carname);         }     } } 

Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -