Can we define two main methods in an application ?

 Posted by Akiii on 6/2/2012 | Category: C# Interview questions | Views: 4443 | Points: 40
Select from following answers:
  1. Yes
  2. No
  3. Not Sure
  4. All Above

Show Correct Answer


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Ashoknalam on: 6/20/2012 | Points: 10
Hi,

one class should not have multiple entry points.

i have copied your code to console app and its working fine.


  class Program1

{
static void Main(string[] args)
{
}
static void Main(string[] args)
{
}
}

above code is wrong will get error as ""Program1' already defines a member called 'Main' with the same parameter types'

please correct if i am wrong
Posted by: Akiii on: 6/20/2012 | Points: 10
Hi,

please show me your code ?


Regards
Akiii

Login to post response