© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4w ago•
11 replies
Hwop

Lists and understanding the errors

beginner
I created a small project to help my understanding of the List function and when i went to go print it it seems like its printing the logic of the list not the numbers in the list its self

Now i understand that I can type something like
Console.WriteLine($"Your List[{numbers[1]});
Console.WriteLine($"Your List[{numbers[1]});

where it would print out the individuale number but when it comes to the entire list it seems like im having an issue ive tried doing just numbers but it types out

Your List[System.Collections.Generic.List`1[System.Int32]]

now im a little lost on where to go it must be a knowlegde gap on the syntax

Any help is appriciated and I look forward from hearing from You Thank you for reading!!!

also here is the full code
using System;
namespace Course
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter the size of the list: ");
            string? userInput = Console.ReadLine();
            int size = Convert.ToInt32(userInput);
            List<int> numbers = new List<int>(size);
            
            for(int i = 0; i < size; i++)
            {
                Console.WriteLine($"Enter list number {i + 1}: ");
                string? usersNumber = Console.ReadLine();
                int listNumber = Convert.ToInt32(usersNumber);
                numbers.Add(listNumber);

            }
            Console.WriteLine($"Your List[{numbers[1]}]");
        }
    }
}
using System;
namespace Course
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter the size of the list: ");
            string? userInput = Console.ReadLine();
            int size = Convert.ToInt32(userInput);
            List<int> numbers = new List<int>(size);
            
            for(int i = 0; i < size; i++)
            {
                Console.WriteLine($"Enter list number {i + 1}: ");
                string? usersNumber = Console.ReadLine();
                int listNumber = Convert.ToInt32(usersNumber);
                numbers.Add(listNumber);

            }
            Console.WriteLine($"Your List[{numbers[1]}]");
        }
    }
}
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Studying singly linked lists and need help understanding pointer functionality
C#CC# / help
17mo ago
❔ Lists
C#CC# / help
3y ago
❔ Lists
C#CC# / help
4y ago
Help with Lists and index.
C#CC# / help
3y ago