Saturday, April 26, 2025

C# OO - Constructors

Program.cs

using System;

namespace LearnCS
{
    class Person
    {
        string status;

        Person() {
            status = "activ";
        }

        static void Main(string[] args)
        {

            Person p1 = new Person();
            Console.WriteLine(p1.status);

            Person p2 = new Person();
            Console.WriteLine(p2.status);

            Console.ReadLine();
        }
    }
}

No comments:

Post a Comment

Tkinter Introduction - Top Widget, Method, Button

First, let's make shure that our tkinter module is working ok with simple  for loop that will spawn 5 instances of blank Tk window .  ...