Powered by Blogger.

Wednesday 18 June 2014

Collection Interface

By Unknown  |  01:11 No comments

Collection Interface;
  1. Collection is group of individual objects as single entity
  2. It is root interface of Collection Framework
  3. Define most common method which is applicable for all collection object

Methods of Collection interface
  1. bollean add (Object o)
  2. boolean addAll(Collection c)
  3. boolean retainAll(Collection c):- To remove all object except present in c
  4. boolean containsAll(Collection c)
  5. boolean remove (Object o)
  6. void clear()
  7. Boolean isEmpty()
  8. int size()
  9. Boolean contains(Object o)
  10. Object[] o= c.toArray()
  11. Iterator i = c.iterator()

Note:-

  • Collection interface doesn’t contain any method to retrieve objects
  • There is no concrete class which implements collection class directly
  • Usually we can use Collections to hold and transfer Objects from one place to another, to provide the support for this requirements Collection already implements Serializable and Cloneable Interfaces.

Author: Unknown

Hello, I am Author, decode to know more: In commodo magna nisl, ac porta turpis blandit quis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In commodo magna nisl, ac porta turpis blandit quis. Lorem ipsum dolor sit amet.

0 comments:

Recent Articles

© 2014 Learning Java. WP themonic converted by Bloggertheme9. Published By Gooyaabi Templates
TOP