-
How can you overload a method?
Different parameter data types, different number of parameters, different order of parameters.
-
What is the role of the DataReader class in ADO.NET connections?
It returns a read-only dataset from the data source when the command is executed.
-
-
Why do I get an error (CS1006) when trying to declare a method without specifying a return type?
If you leave off the return type on a method declaration, the compiler thinks you are trying to declare a constructor. So if you are trying to declare a method that returns nothing, use void. The following is an example: // This results in a CS1006 errorpublic static staticMethod (mainStatic obj)// This will work as wantedpublic static void staticMethod (mainStatic obj)
-
The condition for If statement in C# is enclosed with in
A) ( )B) { }C) [ ]
-
-
Why does DllImport not work for me?
All methods marked with the DllImport attribute must be marked as public static extern.
-
What is the output of Vectors.RemoveAt(1)
A) Removes the object whose key is 1B) Removes the object whose value is 1C) Removes the object at position 1
-
The assembly class is defined in
A) System.ReflectionB) SystemC) System.InteropServices
-
-
What is the difference between shadow and override
Override id used for variables and methods but override only used for methods.
-
1. Are there some features of C# language not supported by .NET?
Skill/Topic: AdvancedA) YesB) NoExplanation: For example some instances of operator overloading!
-
-
-
C# Indexer
1. What is an indexer?2. Why we are using indexer?
-
What is the difference between the System.Array.CopyTo() and System.Array.Clone()?
The first one performs a deep copy of the array, the second one is shallow.
-
The following is a correct call to the Main() function
Skill/Topic: BeginnerA) static void Main()B) static Main(void)C) Main()
-
What is the C# equivalent of System.Single
A) Float (16-bit)B) Float (32-bit)C) Float(64-bit)
-
What does the volatile modifier do
A) The value of the object is written immediately on assignmentB) The value is lost after the system reads it.C) The system stored the value until the end of all current threadsD) The system always reads the current value of a volatile object at the point it is requested
-
Which is not cls compliant built in value type?
Intushortdecimalenum
C# Interview Questions
Ans