Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Collection Defination

Collection Defination

Scheduled Pinned Locked Moved C#
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rahul83
    wrote on last edited by
    #1

    While going through collectios i came across a sentence which says.."An object is called collection if it is able to supply a reference to related object called IEnumerator"..can u please explain me what this sentence actually means..I have an idea of Interfaces.

    G C 2 Replies Last reply
    0
    • R Rahul83

      While going through collectios i came across a sentence which says.."An object is called collection if it is able to supply a reference to related object called IEnumerator"..can u please explain me what this sentence actually means..I have an idea of Interfaces.

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      Rahul83 wrote:

      I have an idea of Interfaces

      Then you'd better find out what an interface is.

      my articles

      1 Reply Last reply
      0
      • R Rahul83

        While going through collectios i came across a sentence which says.."An object is called collection if it is able to supply a reference to related object called IEnumerator"..can u please explain me what this sentence actually means..I have an idea of Interfaces.

        C Offline
        C Offline
        Colin Angus Mackay
        wrote on last edited by
        #3

        Rahul83 wrote:

        While going through collectios i came across a sentence which says.."An object is called collection if it is able to supply a reference to related object called IEnumerator"..can u please explain me what this sentence actually means

        The sentence is incorrect in part. The sentence would read better as: An object can be called a collection if it is able to supply a reference to a related object that implements IEnumerator. The object calling itself a collection must also implement the IEnumerable interface. The IEnumerable interface sets up a contract that the object must have a method called GetEnumerator() which returns an object that implements IEnumerator IEnumerator is used internally with in a foreach loop to get at all the elements in a collection. This is still not the full story, but it does go some way to explaining what that sentence means.


        Upcoming events: * Glasgow: SQL Server 2005 - XML and XML Query Plans, Mock Objects, SQL Server Reporting Services... * Reading: Developer Day 5 Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website

        R 1 Reply Last reply
        0
        • C Colin Angus Mackay

          Rahul83 wrote:

          While going through collectios i came across a sentence which says.."An object is called collection if it is able to supply a reference to related object called IEnumerator"..can u please explain me what this sentence actually means

          The sentence is incorrect in part. The sentence would read better as: An object can be called a collection if it is able to supply a reference to a related object that implements IEnumerator. The object calling itself a collection must also implement the IEnumerable interface. The IEnumerable interface sets up a contract that the object must have a method called GetEnumerator() which returns an object that implements IEnumerator IEnumerator is used internally with in a foreach loop to get at all the elements in a collection. This is still not the full story, but it does go some way to explaining what that sentence means.


          Upcoming events: * Glasgow: SQL Server 2005 - XML and XML Query Plans, Mock Objects, SQL Server Reporting Services... * Reading: Developer Day 5 Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website

          R Offline
          R Offline
          Rahul83
          wrote on last edited by
          #4

          Tahnks a lot for clearing my doubt..

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups