![]() |
| 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 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 ... 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 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 ... Classes in the same namespace. Latest Answer : Namespaces is not correct - The protected modifier allows the field to be accessed only by the inherting class and the base class. If you were to put the modifier 'protected internal' then the field can be accessed by inheriting classes and also by classes ... It is available to derived classes and classes within the same Assembly (and naturally from the base class it is declared in). Latest Answer : Ans:protected internal is available to derived classes and classes within the same Assembly (and naturally from the base class it is declared in). function checkf(form) { var f = document.form1;if (document.form1.cmt.value=='') { alert('Please enter ... No, moreover, you cannot access private methods in inherited classes, have to be protected in the base class to allow any sort of access. Latest Answer : Yes samikcs is correct we cannot declare a method as 'private virtual'.Virtual is used to ovveride this method in the derived class. ... Yes, that is what keyword sealed in the class definition is for. The developer trying to derive from your class will get a message: cannot inherit from Sealed class WhateverBaseClassName. It is the same Latest Answer : can be done by using the keyword "not inhertitable "syntax is not inheritable class '''''''''''''''codeend class ...
Sponsored Links
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||