© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
103 replies
احمد

❔ ✅ c#

Console.WriteLine(Human.objectCount);
Console.ReadLine();

Human bob = new Human("Bob", 18);
Human bobby  = new Human("Bobby", 16);
Human bibby = new Human("Bibby", 11);

class Human
{
    private string name {get; set;}
    private int age {get; set;}
    public static int objectCount;


    public Human(string name, int age)
    {

        this.name = name;
        this.age = age;
        objectCount++;

        Console.WriteLine($"{this.name}'s age is {this.age} and he has connected.");

        Dictionary<Human, Human> nameAndAge = new Dictionary<Human, Human>();



        for (int counter = 0; counter < objectCount; counter++)
        {
            nameAndAge.Add(Human.name, Human.age);
        }
    }
}
Console.WriteLine(Human.objectCount);
Console.ReadLine();

Human bob = new Human("Bob", 18);
Human bobby  = new Human("Bobby", 16);
Human bibby = new Human("Bibby", 11);

class Human
{
    private string name {get; set;}
    private int age {get; set;}
    public static int objectCount;


    public Human(string name, int age)
    {

        this.name = name;
        this.age = age;
        objectCount++;

        Console.WriteLine($"{this.name}'s age is {this.age} and he has connected.");

        Dictionary<Human, Human> nameAndAge = new Dictionary<Human, Human>();



        for (int counter = 0; counter < objectCount; counter++)
        {
            nameAndAge.Add(Human.name, Human.age);
        }
    }
}
image.png
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
Next page

Similar Threads

❔ binding c# and c++
C#CC# / help
3y ago
❔ Linking C# and C++
C#CC# / help
4y ago
C#
C#CC# / help
4w ago
❔ C#
C#CC# / help
3y ago