ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Microsoft Related >> C Sharp
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions (615)
 C Sharp interview questions  C Sharp Interview Questions (722)
 ASP.NET interview questions  ASP.NET Interview Questions (1444)
 VB.NET interview questions  VB.NET Interview Questions (151)
 COM+ interview questions  COM+ Interview Questions (41)
 ADO.NET interview questions  ADO.NET Interview Questions (199)
 IIS interview questions  IIS Interview Questions (86)
 MTS interview questions  MTS Interview Questions (5)
 Crystal Reports interview questions  Crystal Reports Interview Questions (62)
 BizTalk interview questions  BizTalk Interview Questions (34)
 Dot Net interview questions  Dot Net Interview Questions (861)
 Exchange Server interview questions  Exchange Server Interview Questions (103)
 SharePoint interview questions  SharePoint Interview Questions (25)
 WCF interview questions  WCF Interview Questions (8)
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions (193)
Question
what does  static void Main(string[] args) in C# mean????????
 Question Submitted By :: C-Sharp
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
This can be explained as below

public : since the method will be accessed by the other
classes(.net runtime). That is why access modifier is Public

Static:
.net runtime environment call static method of the class
where main is defined. By making Main method as static .net
runtime environment do not need to make object of the class.
runtime environment call the method something like as stated
below.

Class A
{
A()
{}
public static void Main(string[] agrs)
{
}
}

.net Runtime-->
A.Main(args)

Void :
Main method does not return anything

(string[] args):
Here we can pass any number of parameter to the class.
lets say we are making an exe taking 2 parameters then we
can pass parameters to the main method
 
Is This Answer Correct ?    81 Yes 7 No
Subhash
 
Answer
# 2
It is the code starting point and when a function specified with static it will be always available in App Domain (in application). Also no need to create any instance and Classname.Function / Method name will work. The usage of string args[] is read the command line argument. 
Is This Answer Correct ?    23 Yes 3 No
Elan
 
 
 
Answer
# 3
in C# Main function returns something as string. If u dont
want something return to function u have to use Void. And
Static Keyword shows that there should be something in the
function which is static, i.e. WriteLine() is a static
member method of the Console class.
 
Is This Answer Correct ?    39 Yes 44 No
Vaibhav Durhaya
 

 
 
 
Other C Sharp Interview Questions
 
  Question Asked @ Answers
 
What is a delegate?   5
how can i return string by vilating duplicates(inpyt like asdfsda but output should be 2a2d2sf and 2a,2d,2s,f) Microsoft 2
How?s the DLL Hell problem solved in .NET? Visual-Soft 1
What?s a satellite assembly?   2
what is default accessibility for a class? what is difference b/w viewstate and controlstate? what is the default access specifier for a top level class which are not nested into other classes?   2
HOw to judge a person for a team if you are allowed to ask only 2 questions to him? TCS 2
What is difference between interface inheritance and class inheritance ? Digital-GlobalSoft 8
What?s the advantage of using System.Text.StringBuilder over System.String?   1
Can you store multiple data types in System.Array?   5
what are the benefits in using c# ?   1
f i give input like 1,1,4,5,6,1,2,5,4,1,2, then output should be like : 1-4, 2-2, 4-2, 5-1, 6-1 which means 1 occurs 4 times, 2 occurs 2 times like so.   7
Write a functin to add two no. Both no can be int, float. HCL 3
 
For more C Sharp Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com