Saturday, April 26, 2025

C# OO - Namespaces - Internal

using System;
using InternalA;
//using static InternalA.BackupA;
//using INTA = InternalA.BackupA;

namespace LearnCS
{
    class Program
    {
        static void Main(string[] args)
        {
            int number = 50;
            Console.WriteLine(number);
            Console.WriteLine(Storage.testString);

            Storage.DirectPrint();

            Console.WriteLine("X from InternalA nms: " + BackupA.x);
            Console.WriteLine("Y from InternalA nms: " + BackupA.y);

            Console.ReadLine();        
        }
    }
}

namespace LearnCS 
{ 
    class Storage
    {
        public static string testString = "Some String";
        public static char indivindualChar = 'A';

        public static void DirectPrint() {
            Console.WriteLine("I am from Storage Class");
        }
    }
}

namespace InternalA
{
    class BackupA
    {
        public static int x = 5;
        public static int y = 15;
    }
}

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 .  ...