Quick Interview Questions
What is the execution entry point for a C# console application ?
The Main method is the entry point of a C# console application or windows application. When the application is started, the Main method is the first method that is invoked. The Main() method must be static and it should not be public.
More about.....C# console based application
Can we create a console application in c# without Main() method ?
No you can't, All executables in .NET need an entry point.
Every C# application must contain a single Main method specifying where program execution is to begin.
Why Main() method is static ?
A static method can be called without instantiating an object. Therefore main() method needs to be static in order to allow it to be the entry to your program.
What is string args in Main method ?
The string args may contain any number of Command line arguments which we want to pass to Main() method. Parameters are read as zero-indexed command-line arguments. For example args will give you the first command line parameter, if there is one. The Main() method can be declared with or without a string argument that contains command-line arguments. When using Visual Studio to create Windows Forms applications, you can add the parameter manually or else use the Environment class to obtain the command-line arguments.
What is the use of GetCommandLineArgs() method ?
GetCommandLineArgs() returns a string array containing the command-line arguments for the current process. The first element in the array contains the file name of the executing program. The remaining elements contain any additional tokens entered on the command line.
- Does C# support multiple Inheritance ?
- What is Process ID ?
- How do I make a DLL in C# ?
- How many ways you can pass values to Windows Services ?
- Can we use "continue" statement in finally block ?
- What is nullable type in c# ?
- Difference between the Debug class and Trace class ?
- What is lock statement in C#
- What are dynamic type variables in C#
- What is the difference between is and as operator in C#?
- What are circular references in C#?
- What are the differences between events and delegates in C#
- Explain the types of unit test cases in C#?
- How many types of comments are there in C#?
- What are the various ways to pass parameters to a method in C#?
- What are the different ways to deploy a assembly in net?
- What does assert() method do in c#
- What is literals in C# - Constants and Literals
- What is the use of goto statement in C#
- How can JIT code be faster than AOT compiled code
- Why events have no return types in .NET
- What's the difference between a static method and a non-static method in C#
- What's a weak reference c#?
- What is C# equivalent of the vb.net isNothing function
- What are indexers in C#
- What are generics in c#