![]() |
| Home | Tech FAQ | Interview Questions | Placement Papers | Tech Articles | Learn | Freelance Projects | Online Testing | Geeks Talk | Job Postings | Knowledge Base | Site Search | Add/Ask Question |
![]() Related Questions C# does not support an explicit fall through for case blocks. The following code is not legal and will not compile in C#: switch(x){case 0:// do somethingcase 1:// do something in common with 0default:// Latest Answer : c# switch allows fall through if and only if in empty case. as long as there is a statement in the case it must use break or go to to jump out of the case. ... 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, Latest Answer : Ans:No ... No. However, there are plans for C# to support a type of template known as a generic. These generic types have similar syntax but are instantiated at run time as opposed to compile time. You can read more Latest Answer : Generics are a new feature in version 2.0 of the C# language and the common language runtime (CLR). Generics introduce to the .NET Framework the concept of type parameters, which make it possible to design classes and methods that defer the specification ... Yes. Here's a simple example: using System;class Class1 {private string[] MyField;public string[] MyProperty {get { return MyField; }set { MyField = value; }}}class MainClass{public static int Main(string[] Latest Answer : yes u can use indexer.its working is same as properties. ... From language spec:The list of similarities between classes and structs is as follows. Longstructs can implement interfaces and can have the same kinds of members as classes. Structs differ from classes Latest Answer : Following are the main points of difference between classes and structs in C#:Value type vs Reference type: Structs are value type and classes are reference type. Whenever a struct object is assigned to another struct object a copy is created. In case ... Casting the char to an int will give you the ASCII value: char c = 'f';System.Console.WriteLine((int)c);or for a character in a string: System.Console.WriteLine((int)s[3]);The base class libraries Latest Answer : Ans:// Create an ASCII encoding. Encoding ascii = Encoding.ASCII;The base class libraries also offer ways to do this with the Convert class or Encoding classes if you need a particular ... From a versioning perspective, what are the drawbacks of extending an interface as opposed to extending a class? With regard to versioning, interfaces are less flexible than classes. With a class, you can ship version 1 and then, in version 2, decide to add another method. As long as the method is not abstract (i.e., Is it possible to restrict the scope of a field/method of a class to the classes in the same namespace? There is no way to restrict to a namespace. Namespaces are never units of protection. But if you're using assemblies, you can use the 'internal' access modifier to restrict access to only Yes. Try-catch-finally blocks are supported by the C# compiler. Here's an example of a try-catch-finally block: using System;public class TryTest{static void Main(){try{Console.WriteLine("In Latest Answer : Ans:yes ... 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 Latest Answer : Ans:By using the Registry and RegistryKey classes in Microsoft.Win32 ...
Sponsored Links
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||