0 votes
24 views
asked in JAVA by (8.2k points)
HI

  Have a Country as class and i want to store in the arraylist, Need help to create arraylist with specific type?

1 Answer

0 votes
answered by
Hi 

Supose you want an ArrayList to be filled only with Country. If you write:

ArrayList<Country> list = new ArrayList<Country>();
    list.add("A");
    list.add("B");
    list.add("C");

Categories

...