Q-1: IS ARRAYLIST MUTABLE? Ans: Yes Q-2: CAN WE MAKE ARRAYLIST IMMUTABLE? Ans: Yes In Collections: unmodifiableList() Syntax: List newListEmp = Collections.unmodifiableList(Object); Q-3: Is ArrayList object, thread safe? Ans: Thread t1; Thread t2; ArrayList a; t1 =========> process1 t2 ==========> process2 t1 ===========> a t2 ===========> a t1 and t2 ==========> parallelly when a change on the ArrayList through the thread 't1', can reflect on the other thread 't2'. Hence, ArrayList object is not thread safe. Q-4: Is ArrayList Object make as thread safe? ============================================== Instead of making a thread 't1' and thread 't2' parallel, if we make as synchronize: after the execution of 't1' on ArrayList, 't2' execution can start on ArrayList Object. -> In this case the ArrayList Object is thread safe. -> To make an ArrayList object as Synchronize, we can use Collections synchroinzedList() Syntax: List object = Collections.synchronizedList(object); -> If an ArrayList is synchronized, then that ArrayList can execute on only one thread at a time. ============================================================= Q-1: When we can chose ArrayList and when we can chose LinkedList? ==================================================================== CRUD Operations Create Read Update Delete When we need an object with read faster than write ==> ArrayList When we need an object with write faster than read ==> LinkedList. Q-2: Is LinkedList Object mutable or immutable? =============================================== Mutable. Q-3: Can we make a LinkedList as immutable? ============================================ Ans: Yes package pack.pack1; import java.util.Collections; import java.util.LinkedList; import java.util.List; public class MainClass { public static void main(String[] args) { LinkedList list = new LinkedList<>(); list.add("A"); list.add("B"); list.add("C"); System.out.println("The Given LinkedList = "+list); list.add("Z"); System.out.println("The Given LinkedList = "+list); // Making the given linked list object as immutable List immutableObject = Collections.unmodifiableList(list); list.add("P"); System.out.println("The Given LinkedList = "+list); immutableObject.add("r"); System.out.println(immutableObject); } } Q-4: Is LinkedList object thread safe? ====================================== No Q-5: Can we make LinkedList Object as thread safe? =================================================== Yes by making the linked list object as Synchronized.