user define string to arraylist in java code example
Example 1: java how to create arraylist
import java.util.ArrayList;
//create ArrayList
ArrayList<String> arrayList = new ArrayList<String>();
Example 2: how add model class to array list
//main class
SomeClass b= new SomeClass();
list.add(b);
//subclass
Home.MainCategory mainCategory = new Home().getInstranceMainCategory();
mainCategory.mainCatName = getString(R.string.more);
mainCategoryList.add(mainCategory);