-
What is an abstract class?
A class that cannot be instantiated. A concept in C++ known as pure virtual method. A class that must be inherited and have the methods over-ridden. Essentially, it is a blueprint for a class without any implementation.
-
How can you overload a method?
Different parameter data types, different number of parameters, different order of parameters.
-
-
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.
-
Can multiple catch blocks be executed?
No, once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block.
-
What is the difference between // comments, /* */ comments and /// comments?
Single-line, multi-line and XML documentation comments.
-
What is the difference between the Debug class and Trace class?
Documentation looks the same. Use Debug class for debug builds, use Trace class for both debug and release builds.
-
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.
-
How do you inherit from a class in C#?
Place a colon and then the name of the base class. Notice that it's double colon in C++.
-
Are private class-level variables inherited?
Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited. But they are.
-
What is CTS?
Skill/Topic: BeginnerA) Common Translation systemB) Csharp Type SystemC) Common Type SystemD) Constants Translation Specification
-
ASP.NET web pages can be programmed in C#?
Skill/Topic: BeginnerA) YesB) No
-
Every statement in C# must end in
Skill/Topic: BeginnerA) ;B) ,C) #
-
To write a line of text to the xonsole window, we make the following call
Skill/Topic: BeginnerA) Console.WriteLine()B) console.writeline()C) System.Output()
-
All the variables local to a method in C# must be initialized before they can be used
Skill/Topic: BeginnerA) TrueB) False
-
Which of the following is the correct way to instantiate an object in C#:
Skill/Topic: BeginnerA) objThis = System.CreateObject( ThisObject);B) objThis = new ThisObject();
-
A class type in C# is a value type
Skill/Topic: BeginnerA) YesB) NoExplanation: It is a reference type
-
Which of the following are predefined reference types in C#?
Skill/Topic: BeginnerA) intB) objectC) string
-
All types in C# implicitly derive from
Skill/Topic: BeginnerA) System.Object classB) System classC) System.CSharp class
-
What is similar in concept to IL?
Skill/Topic: IntermediateA) Java Byte CodeB) C++ LibrariesC) Machine Language
C# Interview Questions
Ans