pravin pravin - 5 months ago 12
Android Question

What is the main difference between "List and Arraylist" , "HasMap and Treemap", "Boolean and boolean" and when to use when?

I am bit confused regarding the differences between the following types in Android:-

1.List and Arraylist
2. HashMap and TreeMap
3. Boolean and boolean

Also I want suggestion that in Android its better to use SharedPreferences or Android Sqlite ? And how to use new FIREBASE database ??

Also, Please suggest me when to use which type...??

Answer

Try this code:

 List<String> yourList = new ArrayList<>();
 yourList.add("text1");
 yourList.add("text2"); 
 String [] yourArray = yourList.toArray(new String[yourList.size()]);
Comments