How to call a static method in a nested namespace with C#

1 Answer

0 votes
using System;

namespace ANameSpace
{
    public class Print
    {
        static void Main()
        {
            NestedNameSpace.Test.Print();
        }
    }

    namespace NestedNameSpace
    {
        public class Test
        {
            public static void Print() {
                Console.WriteLine("C# Java C++");
            }
        }
    }
}

 
   
   
/*
run:
   
C# Java C++
   
*/

 



answered Nov 26, 2020 by avibootz

Related questions

1 answer 183 views
2 answers 142 views
142 views asked Nov 26, 2020 by avibootz
1 answer 161 views
1 answer 200 views
1 answer 220 views
1 answer 167 views
...