Results 1 to 6 of 6

Thread: Collections in c#

  1. #1
    Join Date
    Jan 2009
    Posts
    65

    Collections in c#

    Hello, I am student of BSC.I.T. and learning C# currently. I want details about the Collection classes in C#. If anyone is having knowledge about it then please provide me that. I have searched on internet But the language used is too much difficult. So, if you provide me some points about it then it can be helpful to me.

  2. #2
    Join Date
    Nov 2005
    Posts
    3,026

    Re: Collections in c#

    When .Net Framework is developed it is developed with the facility that will able to provide you specialized classes for storing your data and also retrieve your stored data. These classes can support for the stacks, queues, lists, and hash tables. Most of the time you can come to know that the most of the collection classes will implement the same interface and those all interfaces will be inherited to create new collection classes.

  3. #3
    Join Date
    May 2008
    Posts
    2,684

    Re: Collections in c#

    If you want to implement the custom collection class then you may need to use the coding below:

    Code:
    using System;
    using System.Collections;
    public class First: CollectionBase
    {
      public First this[int i]
      {
        get
        {
          return ((First)(List[i]));
        }
        set
        {
          List[i] = value;
        }
      }
     
      public bool Contains(First first)
      {
        return List.Contains(first);
      }
     
      public int Add(First First)
      {
        return List.Add(First);
      }
     
      public void Insert(int i, First first)
      {
        List.Insert(i, first);
      }
     
      public void Remove(First first)
      {
        List.Remove(First);
      }
    }

  4. #4
    Dr. V Guest

    Re: Collections in c#

    If you consider the collections in C# then you come to know that the c# collections may contain mane different forms. The System.Collections namespace provides you different classes, methods and properties.
    System.Collections namespace includes following interfaces:
    • IEnumerable
    • IEnumerator
    • ICollection
    • IList
    • IDictionary

  5. #5
    Join Date
    Jan 2008
    Posts
    3,388

    Re: Collections in c#

    For getting more information about the C# collections you may need to use the different books provided by the different authors. You can also search for the different pdf files which are available free of cost on internet and get knowledge about the c# from that. So, just make use of all those sources and you will able to get the solution for it.

  6. #6
    Join Date
    Apr 2008
    Posts
    3,270

    Re: Collections in c#

    C# uses collection classes for different purposes. It is the set of classes which are developed for specially making group of objects and by the use of them you can able to perform specific task from them. There are many more collection classes available in C#, but mostly list and arraylist is used.

    Syntax for creating a List<T> :
    Code:
    List<type> name = new List<type>();
    Syntax for creating a ArrayList :
    Code:
    ArrayList name = new ArrayList();

Similar Threads

  1. Is there any need of collections in Garden of Time
    By Jagjeet-J in forum Video Games
    Replies: 7
    Last Post: 24-12-2011, 04:47 AM
  2. Collections available in FrontierVille
    By Meditation in forum Video Games
    Replies: 4
    Last Post: 07-02-2011, 09:16 AM
  3. Collections in Java
    By blueprats in forum Guides & Tutorials
    Replies: 3
    Last Post: 22-03-2010, 02:51 PM
  4. ConcurrentModificationException in Collections
    By ISAIAH in forum Software Development
    Replies: 5
    Last Post: 23-02-2010, 04:42 AM
  5. Ordered index in Collections
    By Aaliya Seth in forum Software Development
    Replies: 5
    Last Post: 20-02-2010, 12:46 AM

Posting Permissions

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