TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Interviews
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
iOS
Java
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
Can i have more than Main() function in c#. Give the explanation
By
Munesh Sharma
in
.NET
on
Mar 15
2011
0
5.8k
1
Post Your Answer
Submit
Mar, 2011
16
Yes,We can have more than one Main function in C# program.............
Just take an Example
using System;
class A
{
public static void Main()
{
Console.WriteLine("Class A");
}
}
class B
{
public static void Main()
{
Console.WriteLine("Class B");
}
}
class C
{
public static void Main()
{
Console.WriteLine("Class C");
}
}
save this as file.cs.
and in the cmd run this file
as
command:--
csc file.cs /main:classname
className is the name of the class which you want to compile now...
I hope you get ur answer .if you are not satisfied rep soon..............and post your comments.
0
What is the Defiance between Interfaces and Abstract classes
What is the Defiance between Interfaces and Abstract classes
Most Popular Job Functions
Developer (1609)
Programmer (1253)
Senior Management (1222)
Sr. Developer (666)
Sr. Programmer (432)
Fresher (402)
Tech Lead (265)
DBA (245)
Team Lead (189)
Project Lead (86)
View All
MOST LIKED QUESTIONS
What are the advantages of using REST in Web API?
Why do you want to leave your current company?
A class provides a default constructor for me. I write a constructor that takes a string as...
Which Is Faster MVC or ASP.net ?
What is file extension of Webservices in .Net?
What is ASP.NET Core?
.NET interview questions :- Can you explain architecture of your project ?
In which situation(s), the use of "Delegate" is a good idea?
What is a View ?Can we insert,Update and delete a view?
What is the difference between Convert.ToString() and .ToString()?