Sponsored Ad

Saturday, March 12, 2011

string vs System.String : C# Interview questions

Today i got a question that what is difference between string vs System.String . suddenly i was not able to recall it. i went to my laptop and tried with a program and find out the both are same. string is alias for System.String. 

Same there is number of alias C# provide. you can go to msdn and check it.

string vs System.String : C# Interview questions 

 

using System;

namespace MyApp
{
    class my_class
    {
        static void Main(string[] args)
        {
            System.String str1 = "abc";
            string str2 = "abc";

            Console.WriteLine(str1);
            Console.WriteLine(str2);               

            Console.ReadLine();
        }

    }
}

No comments:

Post a Comment

Sponsored Ad

Development Updates