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. Can you store multiple data types in System.Array? No. Is it possible to inline assembly or IL in C# code? No. Can you declare the override method static while the original method is non-static? No, you cannot, the signature of the virtual method must remain the same, only the keyword virtual is changed to keyword override Does C# support multiple inheritance? No, use interfaces instead. 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. Can you override private virtual methods? No, moreover, you cannot access private methods in inherited cla...
How can I access the registry from C# code? By using the Registry and RegistryKey classes in Microsoft.Win32, you can easily access the registry. The following is a sample that reads a key and displays its value: using System;using Microsoft.Win32; class regTest { public static void Main(String[] args) { RegistryKey regKey; Object value; regKey = Registry.LocalMachine; regKey = regKey.OpenSubKey("HARDWAREDESCRIPTIONSystemCentralProcessor "); value = regKey.GetValue("VendorIdentifier"); Console.WriteLine("The central processor of this machine is: {0}.", value); } } How can you sort the elements of the array in descending order? By calling Sort() and then Reverse() methods. How do you debug an ASP.NET Web application? Attach the aspnet_wp.exe process to the DbgClr debugger. How do you mark a method obsolete? Assuming you've done a "using System;": [Obsolete] public int Foo() {...} or [Obsolete("This is a message describing why this me...
What's C# ? C# (pronounced C-sharp) is a new object oriented language from Microsoft and is derived from C and C++. It also borrows a lot of concepts from Java too including garbage collection. More at http://msdn.microsoft.com/vstudio/nextgen/technology/csharpintro.asp, http://msdn.microsoft.com/library/default.asp?URL=/library/dotnet/csspec/vclrfcsharpspec_Start.htm and http://msdn.microsoft.com/vstudio/nextgen/technology/csharpdownload.asp Is it possible to inline assembly or IL in C# code? - No. Is it possible to have different access modifiers on the get/set methods of a property? - No. The access modifier on a property applies to both its get and set accessors. What you need to do if you want them to be different is make the property read-only (by only providing a get accessor) and create a private/internal set method that is separate from the property. Is it possible to have a static indexer in C#? allowed in C#. - No. Static indexers are not If I return out of a try/fi...