Why does DllImport not work for me? What is a delegate? What is the difference between an interface and abstract class? What is an abstract class? Does C# support multiple-inheritance? Who is a protected class-level variable available to? Can you store multiple data types in System.Array? What’s the top .NET class that everything is derived from? What does the term immutable mean? What’s the difference between System.String and System.Text.StringBuilder classes? What’s the advantage of using System.Text.StringBuilder over System.String? What’s the difference between the System.Array.CopyTo() and System.Array.Clone()? How can you sort the elements of the array in descending order? What’s the .NET collection class that allows an element to be accessed using a unique key? What class is underneath the SortedList class? Will the finally block get executed if an exception has not occurred? What’s the C# syntax to catch any possible exception? Can multiple catch blocks be executed for a single try statement? Explain the three services model commonly know as a three-tier application.
All methods marked with the DllImport attribute must be marked as public static extern.
A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers.
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.
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.
_break
No.
It is available to any sub-class (a class inheriting this class).
No.
System.Object.
The data value may not be changed. Note: The variable value may be changed, but the original immutable data value was discarded and a new data value was created in memory.
System.String is immutable. System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.
StringBuilder is more efficient in cases where there is a large amount of string manipulation. Strings are immutable, so each time a string is changed, a new instance in memory is created.
The first one performs a deep copy of the array, the second one is shallow. A shallow copy of an Array copies only the elements of the Array, whether they are reference types or value types, but it does not copy the objects that the references refer to. The references in the new Array point to the same objects that the references in the original Array point to. In contrast, a deep copy of an Array copies the elements and everything directly or indirectly referenced by the elements.
By calling Sort() and then Reverse() methods.
HashTable.
A sorted HashTable.
Yes.
A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.
No. Once the proper catch block processed, control is transferred to the finally block (if there are any).
Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources).
C# Questions Continue..
Labels: C# Technical