CoolInterview.com - World's Largest Collection of Interview Questions
 Interview Questions  
 Our Services  

Get 9,000 Interview Questions & Answers in an eBook.


  • 9500+ Pages
  • 9000 Question & Answers
  • All Tech. Categories
  • 14 MB Content

    Get it now !!


    Send your Resume to 6000 Companies


  • INTERVIEW QUESTIONS MICROSOFT C# DETAILS
    Question :
    What happens when a C# project has more than 1 Main methods


    Category C# Interview Questions
    Rating (4.0) By 3 users
    Added on 7/28/2006
    Views 1167
    Rate it!
    Answers:

    If the project is compiled using /main switch with the compiler then the project compiles successfully.

    For example:
    class A
    {
    public static void Main(string[] args)
    {
    Console.WriteLine("Main in class A");
    }
    }

    class B
    {
    public static void Main(string[] args)
    {
    Console.WriteLine("Main in class B");
    }
    }

    Now compile with the /main switch with the C# compiler like
    csc MultipleMain.cs /main:A

    This will compile without error and while executing it will show Main in class A

    Attempting to compile an application consisting of multiple classes with defined Main methods and not specifying the /main switch will result in a compiler error.





    If you have the better answer, then send it to us. We will display your answer after the approval.
    Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification  Enter the above shown code:*
    Inform me about updated answers to this question

       
    Related Questions
    View Answer
    Which of the following explicit type conversion is achieved with out loosing the original data value

    View Answer
    Which of these operator has the Highest Precedence

    View Answer
    How do you determine the size required by a Value type on the stack

    View Answer
    How do you check whether an Object is compatible with Specific Type

    View Answer
    How do you make CLR enforce overflow checking

    View Answer
    X=X+1 is equivalent to

    View Answer
    If we need to compare X to a value 3 how do we do it in C#

    View Answer
    Which operator is used for TypeCasting

    View Answer
    Array declaration in C# is done with

    View Answer
    How to get the capacity of an array in C#

    View Answer

    Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

    Notify me when better answer is posted!
    Email:

    View ALL C# Interview Questions

    User Options
    Sponsored Links


    Copyright ©2003-2009 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions
    Page URL: http://www.coolinterview.com/interview/8990/default.asp?cachecommand=bypass


    Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Dedicated Servers | Joke of the Day

    0.44