-
-
Even if an exception hasn’t occurred, the ‘finally’ block will get executed
Skill/Topic: IntermediateA) YesB) NoExplanation: Finally block is always executed
-
Applications running in different App Domains can't communicate with each other:
Skill/Topic: AdvancedA) TrueB) FalseExplanation: The can communicate
-
Which of the following has stream as the base class
A) Buffered StreamB) MemoryStreamC) FileStream
-
-
Public policy applies to
A) Shared assembliesB) Private assembliesC) Both
-
What happens when a C# project has more than 1 Main methods
A) Compiler throws warning messageB) Compiler throws Error messageC) Compiler successfully compiles
-
How do you refer parent classes in C#
A) SuperB) ThisC) Base
-
-
Which of the following application need not to have an entry point
A) Console applicationB) Windows applicationC) Class ModulesExplanation: Class modules are referred by another project which will have entry point.
-
It is not possible to debug the classes written in other .Net languages in a C# project.
A) TrueB) FalseExplanation: It is possible to debug the code as all are adhering to CTS & CLS
-
-
Following are the features of .NET
Skill/Topic: IntermediateA) Language InteroperabilityB) Garbage CollectionC) Multiple Inheritance
-
-
How can you sort the elements of the array in descending order?
By calling Sort() and then Reverse() methods.
-
You can explicitly call the garbage collector
Skill/Topic: AdvancedA) TrueB) False
-
What is an indexer in C#
A) Special syntax for overloading [ ] operator for a classB) One which speeds up the function callC) None of the above
-
Describe the accessibility modifier protected internal.
It's available to derived classes and classes within the same Assembly (and naturally from the base class it's declared in).
-
C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?
Two. Once you write at least one constructor, C# cancels the freebie constructor, and now you have to write one yourself, even if there is no implementation in it.
-
Does C# support C type macros?
No. C# does not have macros. Keep in mind that what some of the predefined C macros (for example, __LINE__ and __FILE__) give you can also be found in .NET classes like System.Diagnostics (for example, StackTrace and StackFrame), but they'll only work on debug builds.
C# Interview Questions
Ans