- What’s the difference between an interface and abstract class? In the interface all methods must be abstract; in the abstract class some methods can be concrete. In the interface no accessibility modifiers are allowed, which is ok in abstract classes.
- How can you overload a method? Different parameter data types, different number of parameters, different order of parameters.
- If a base class has a bunch of overloaded constructors, and an inherited class has another bunch of overloaded constructors, can you enforce a call from an inherited constructor to an arbitrary base constructor? Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class.
- What’s the difference between System.String and System.StringBuilder classes? System.String is immutable; System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.
- What’s the advantage of using System.Text.StringBuilder over System.String? StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it’s being operated on, a new instance is created.
- Can you store multiple data types in System.Array? No.
- What’s 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.
- How can you sort the elements of the array in descending order? By calling Sort() and then Reverse() methods.
- What’s the .NET datatype that allows the retrieval of data by a unique key? HashTable.
- What’s class SortedList underneath? A sorted HashTable
Interview Questions C Sharp set-3
Posted by
study
|
Tuesday 7 June 2011
Popular Posts
-
What is software engineering, anyway? Some basic def...
-
Technical Interview Questions 1. Which is the best page replacement algorithm and why? 2. What is software life cycle? 3. How much time...
-
Q: What are Checked and UnChecked Exception? A: A checked exception is some subclass of Exception (or Ex...
-
Q: Is next a keyword in Java? A: No, next is not a keyword. Q: ...
-
Explain user defined exceptions in oracle. A User-defined exception has to be defined by the programmer. User-defined exceptions are decla...
-
1. For a parallel plate capacitor which is being charged out of the following the incorrect statement is – a). Energy stored in the capaci...
-
1.In the command scanf, h is used for Ans. Short int 2.A process is defined as Ans. Program in execution 3.A thread is Ans. Deta...
-
Q: What is the difference between an Interface and an Abstract class? A: An abstract class can have inst...
-
Explain the attributes of implicit cursor a. %FOUND - True, if the SQL statement has changed any rows. b. %NOTFOUND - True, if record was...
0 comments:
Post a Comment