google search

Thursday, July 2, 2009

Can I use typedefs in C#?

Can I use typedefs in C#?

 

C# doesn't have typedef but It does have it in the form of using. But this is limited in terms of usage and functionality

 

Ex.

 

using EmpList = System.Collections.Generic.List<MyNameSpace.Employee>;
using NUMBER = System.Int32;

namespace
MyNameSpace

{

    public class Employee

    {

    }


    public
class Class1

    {

        public Class1()

        {

            EmpList empList = new EmpList();
            NUMBER num = 8;

        }

    }
}

 


No comments: