Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Collections in c#

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 20-01-2010
Member
 
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.

Reply With Quote
  #2  
Old 20-01-2010
Member
 
Join Date: Nov 2005
Posts: 3,022
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.
Reply With Quote
  #3  
Old 20-01-2010
Member
 
Join Date: May 2008
Posts: 2,675
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);
  }
}
Reply With Quote
  #4  
Old 20-01-2010
Dr. V
 
Posts: n/a
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
Reply With Quote
  #5  
Old 20-01-2010
Member
 
Join Date: Jan 2008
Posts: 3,384
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.
Reply With Quote
  #6  
Old 20-01-2010
Member
 
Join Date: Apr 2008
Posts: 3,259
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();
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Collections in c#"
Thread Thread Starter Forum Replies Last Post
Is there any need of collections in Garden of Time Jagjeet-J Video Games 7 24-12-2011 05:47 AM
Collections available in FrontierVille Meditation Video Games 4 07-02-2011 10:16 AM
Collections in Java blueprats Guides & Tutorials 3 22-03-2010 03:51 PM
ConcurrentModificationException in Collections ISAIAH Software Development 5 23-02-2010 05:42 AM
Ordered index in Collections Aaliya Seth Software Development 5 20-02-2010 01:46 AM


All times are GMT +5.5. The time now is 03:00 PM.