| |
|
Can we set different types of parameters & return-types in main() method"?
Yes. The Main() method may easily be played around with by developers by passing different parameters
and setting different return types. See the code below, that demonstrates different ways the Main()
method may be implemented:
C# Example
(1)
public static void Main(string[] args)
{
//NO return type, the argument is an array of strings
}
(2)
public static int Main(string[] args)
{
//Return type is int, argument is an array of strings
}
(3)
public static int Main()
{
//Return type is int, NO arguments
}
(4)
public static void Main()
{
//Return type is void, NO arguments
}
Protected Internal
Array
Sort Array
Throw
Multiple Catch
Polymorphism
Inheritance
Session Viewstate
Autogenerate
ReadOnly
Sealed Class
Sealed Method
Multiple Interfaces
Overloading
Overloaded Constructors
Generics
Main
Case Sensitive
Console
Specifier
Return Type
SetCommandLineArgs
System Environment
New
Default Values of Types
Compiler Error
Constant Variable
Const
Const - ReadOnly
Parameter Modifier
Out Ref
Interface
Interface Reference, is, as
System.Collection
More Interview Questions...
| |