-
Which of the following is used to denote comments in C#?
Skill/Topic: IntermediateA) /* */B) //C) ///Explanation: /// is used from XML documentation
-
IF a namespace isn't supplied, which namespace does a class belong to
Skill/Topic: IntermediateA) a nameless global namespaceB) SystemC) Windows
-
1. Are there some features of C# language not supported by .NET?
Skill/Topic: AdvancedA) YesB) NoExplanation: For example some instances of operator overloading!
-
Interface members can not be declared as
A) VirtualB) StaticC) PrivateD) All of the above
-
What is the difference between shadow and override
Override id used for variables and methods but override only used for methods.
-
All .NET code have to be CLS compliant
Skill/Topic: IntermediateA) TrueB) False
-
What happens if we refer a variable which in not initialized in C#
A) Compiler throws warning messageB) Compiler throws error messageC) Compiles the application with out any problemExplanation: Variable needs to be initialized before use
-
-
-
Multicast Delegate
What is multicast delegate? When it is used?
-
When to use string classes
when we have string builder which are mutable why we need immutable string classes in C#.
-
What is managed code?
Skill/Topic: IntermediateA) Code managed ouside the ILB) Code which can't be managed by the ILC) Code written in VB.NETD) Code to be compiled by IL
-
-
What is the difference between const and static read-only?
The difference is that static read-only can be modified by the containing class, but const can never be modified and must be initialized to a compile time constant. To expand on the static read-only case a bit, the containing class can only modify it:-- in the variable declaration (through a variable initializer).-- in the static constructor (instance constructors if it's not static).
-
Value Types are stored on the heap ..? Is it true/False ?
Skill/Topic: AdvancedA) TrueB) False
-
By declaring a base class function as virtual we allow the function to be overridden in subclasses
A) TrueB) FalseExplanation: If a function is declared virtual it needs to be overridden in subclass
-
-
-
-
Value of x
This is interview question,public void A() { int x; x = 8; x *= 4 + 8 / 2; } Given the above code, what is the value of "x"?options:- A) 3 B) 2 C)4 D) None
C# Interview Questions
Ans