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. ERROR IN Generic Collections

ERROR IN Generic Collections

Scheduled Pinned Locked Moved C#
csharplinqhelpquestion
1 Posts 1 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.
  • S Offline
    S Offline
    Sandhya Bandar
    wrote on last edited by
    #1

    -----------------------Program on Generic Collections---------------------------------------- using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CollectionsGENERIC { class Program { static void Main(string[] args) { List numbers = new List(); numbers.Add(1); numbers.Add(2); numbers.Add(3); foreach (int x in numbers) { Console.WriteLine("{0}", numbers); } Console.WriteLine(".............."); List str = new List(); str.Add("a"); str.Add("b"); str.Add("c"); foreach (string y in str) { Console.WriteLine(str); } Console.ReadLine(); } } } ---------------------------------------------------------------------- When i executed above Program i am getting below Error ---------------------------------------------------------------------- System.Collections.Generic.List`1[System.Int32] System.Collections.Generic.List`1[System.Int32] System.Collections.Generic.List`1[System.Int32] .............. System.Collections.Generic.List`1[System.String] System.Collections.Generic.List`1[System.String] System.Collections.Generic.List`1[System.String] --------------------------------------------------------------------------- Could anyone Tell me where i did mistake?

    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