12:29 am - Thursday June 29, 2017

Collections example programs and Tutorial in java

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

BACK

   1. Insert a collection element in already excisting collection using AddAll()

   2. View of Deque in Last-in-first-out order using as LifoQueue()

   3.  Search a particular list in collection using binarySearch(List<? extends T>,T,Comparator<?super T>

  4.Replace all value with another list in collection using public static <T> boolean replaceAll(List<T>list,T oldVal,T newVal)

   5.Swap the element in collection using public static void swap(List<?> list,int i, int j)

  6.Copy of elements from one to another in collection using public static <T> void copy(List<? super T>dest, List<? extends T>src)

  7..Dynamically typesafe view in collection using public static <E> Collection<E> checkedCollection(Collection<E> c, Class<E>type)

  8.Typesafe view by specified Map in collection public static <K,V>Map<k,v> checkedMap(Map<K,V> m, Class<K> keyType, Class<V> valueType)

  9.Reverse the order of elements in collection using public static void reverse(list<?> list)

 10.Replace all elements of a list using  public static<T> void fill(List<? super T> list,T obj)

11.The Program is used to get a dynamically typesafe view of the specified list using checkedList(List<E>, Class<E>) method

12. This Program is used to get a dynamically typesafe view of the specified sorted map using checkedSortedMap(SortedMap<, V>, Class<K>, Class<V>)

13. This Program is used  to get a dynamically typesafe view of the specified sorted set using checkedSortedSet(SortedSet<E>, Class<E>) method.

14. This Program is used to ‘true’ if the two specified collections have no elements in common using disjoint(Collection<?>, Collection<?>)

15. This Program is used to get the empty map (immutable) using emptyMap() method

16. This Collection Program is used to get the max elements using max() Method

17. This Collection Program is used to get the min elements using min() Method

18. Collections.min(Collection <? extends T> coll, Comparator <? super T> comp)

19. This Program is used to copying the number of lists using Collections.ncopies() Method

20. This Collections Program is used to set the elements using newSetFromMap() Method

21. The unmodifiableCollection() method is used to return an unmodifiable view of the specified  collection using unmodifiableCollection(Collection<? extends T> c)

22. The unmodifiableList() method is used to returns an unmodifiable view of the specified list unmodifiableList(List<? extends T> list)

23. The SortedSet interface extends Set and declares the behavior of a set sorted in ascending order using synchronizedSortedSet(SortedSet<T> s)

24.The unmodifiableMap() method is used to return an unmodifiable view of the specified map in descending order using unmodifiableMap(Map<? extends K,? extends V> m)

25.The unmodifiableSet() method Returns an unmodifiable view of the specified set in Descending order using unmodifiableSet(Set<? extends T> s)

26.The unmodifiableSortedMap() method is used to return an unmodifiable view of the specified sorted map. in ascending order using unmodifiableSortedMap(SortedMap<K,? extends V> m)

27. The Collection Program Singleton  used to return an immutable list containing only the specified object using SingletonList(T o) method.

28.The Collection  Program Silgleton Returns an immutable set containing only the specified object using singleton(T o) method

29.The Collection Program singletonMap used to get an immutable map, mapping only the specified key to the specified value using singletonMap(K, V) method

30.The Collection Program Sorts the specified list into ascending order, according to the natural ordering of its elements using sort(List<T> list)

31.The Collection Program sort the specified list according to the order induced by the specified comparator using sort(List<T> list, Comparator<? super T> c) method

32.Java Program is used to return a view of the portion of this List between fromIndex, inclusive, and toIndex, exclusive using subList(int fromIndex,int toIndex) method

33.Java Program returns an array containing all of the elements in this collection using Object[] toArray() method

 34.Java Program returns an array containing all of the elements in this list in proper sequence (from first to last element) using <T> T[] toArray(T[] a) method

35.Java Program is used for memory optimization. It trims the capacity ofArrayList to the current list size using trimToSize() method

 

BACK

Filed in: Java Examples

Comments are closed.