-
Which of the following is not a subclass of Value Type class
A) EnumerationsB) User defined value typesC) Boxed value typesExplanation: Boxed value types are of reference types
-
-
-
Can you allow class to be inherited, but prevent the method from being over-ridden?
Yes, just leave the class public and make the method sealed.
-
Which is not cls compliant built in value type?
Intushortdecimalenum
-
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
-
What is the C# equivalent of System.Single
A) Float (16-bit)B) Float (32-bit)C) Float(64-bit)
-
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 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.
-
-
-
1. Are there some features of C# language not supported by .NET?
Skill/Topic: AdvancedA) YesB) NoExplanation: For example some instances of operator overloading!
-
What is the difference between shadow and override
Override id used for variables and methods but override only used for methods.
-
-
The assembly class is defined in
A) System.ReflectionB) SystemC) System.InteropServices
-
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
-
Why does DllImport not work for me?
All methods marked with the DllImport attribute must be marked as public static extern.
-
-
The condition for If statement in C# is enclosed with in
A) ( )B) { }C) [ ]
-
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)
C# Interview Questions
Ans