예제 #1
0
    // Main begins program execution.
    public static void Main()
    {
        // Instance of OutputClass
        OutputClass outCl = new OutputClass("This is printed by the output class.");

        // Call Output class' method
        outCl.printString();
    }
예제 #2
0
    // Main begins program execution
    public static void Main()
    {
        OutputClass outC1 = new OutputClass("This is printed by the output class.");

        // Call output class' method
        outC1.printString();
        OutputClass.staticPrinter();
    }
예제 #3
0
    // Main begins program execution.
    public static void Main()
    {
        // Instance of OutputClass
        OutputClass outCl = new OutputClass("This is printed by the output class.");

        // Call Output class' method
        outCl.printString();
    }
예제 #4
0
    // Main begins program execution.
    public static void xMain()
    {
        // Instance of OutputClass
        OutputClass outCl = new OutputClass("This is printed by the output class.");

        // Call Output class' method
        outCl.printString();

        // keep screen from going away
        // when run from VS.NET
        Console.ReadLine();
    }
        public static void ExampleClass()
        {
            // Instance of OutputClass
            var outCl = new OutputClass("This is printed by the output class.");
            var outC2 = new OutputClass(5);
            var outC3 = new OutputClass();


            // Call Output class' method
            outCl.printString();
            outC2.printString();
            outC3.printString();

            // Call static field that previously inicializated by static constructor
            AliasForNamespace.Console.WriteLine(OutputClass._count);

            // AliasForNamespace.GC.Collect(); // Why GC not work because link on object exist because object in method scope
        }
예제 #6
0
    // Main begins program execution.
    public static void Main2()
    {
        // Instance of OutputClass
           // OutputClass outCl = new OutputClass("This is printed by the output class.");
        OutputClass outCl = new OutputClass("1","2");
        // Call Output class' method
        outCl.printString();

        OutputClass oc2 = new OutputClass("OutputClass2");
        oc2.printString();
        OutputClass.staticPrinter();
    }