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
Post a Comment