Results 1 to 4 of 4

Thread: What is the Difference Between Collection and Collections?

  1. #1

    Question What is the Difference Between Collection and Collections?

    Its very confusing sometimes. Please help me out with it.
    techforum4u.com Member!!

  2. #2

    Re: What is the Difference Between Collection and Collections?

    Collections class is a utility class having static methods. Collections has methods for finding maximum number of elements in collection.

    Collection is an interface....(it is the root interface of java collection framework)
    techforum4u.com Member!!

  3. #3

    Re: What is the Difference Between Collection and Collections?

    Collection is a base interface for most collection classes, whreas Collections is a utility class. I recommend you reading documentation.
    techforum4u.com Member!!

  4. #4

    Re: What is the Difference Between Collection and Collections?

    Collection, as its javadoc says is "The root interface in the collection hierarchy." This means that every single class implementing Collection in any form is part of the Java Collections Framework.

    The Collections Framework is Java's native implementation of data structure classes (with implementation specific properties) which represent a group of objects which are somehow related to each other and thus can be called a collection.

    Collections is merely an utility method class for doing certain operations, for example adding thread safety to your ArrayList instance by doing this:

    List<MyObj> list = Collections.synchronizedList(new Arraylist<MyObj>());
    The main difference in my opinion is that Collection is base interface which you may use in your code as a type for object (although I wouldn't directly recommend that) while Collections just provides useful operations for handling the collections.
    techforum4u.com Member!!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Disclaimer: Users of techforum4u.com are responsible for ensuring that any material they post (article, blog posts, images or other mulitimedia content) does not violate or infringe upon the copyright, patent, trademark, or any personal or proprietary rights of any third party, and is posted with the permission of the owner of such rights.Anyone who violates these rules may have their access privileges removed without warning.