Posts

Showing posts from April, 2021
Image
                                                                      Learning to Code                                                                  ArrayList.                                                                  Question - I mplementing all methods of ArrayList  Create an ArrayList Num with size 12. add  6 numbers 12,14,65,56,80,100 adjust the size automatically.  Show the each item of arraylist iterating.  Remove 100 and find last index of 14. Check whether 99 belong to ArrayList or not. How to find arraylist is not empty. Set element 12 to 873 ..use clone method and clear  check if element at 4 index is 98 or not Convert Num to array.                                                Solution- import java.util.*; public class DsArrayList { public static void main (String Args[]){ ArrayList al= new ArrayList(); ArrayList<Integer> Num = new ArrayList<>(12); //add method Num.add(12); Num.add(14); Num.add(65); Num.add(56); Num.