C#.Net Interview Question and Answers

41. what are value types and reference types?
  Value types are stored in the Stack.
Examples : bool, byte, char, decimal, double, enum , float, int, long, sbyte, short, strut, uint, ulong, ushort.

Reference types are stored in the Heap.
Examples : class, delegate, interface, object, string.
 
Digvijay Kumar Singh, said Jan 17,2014
Value type is have the structure design and maintained by structure so it is stored in stack. Reference type is have the class design and data maintained by class so it is stored in Heap. Value type do’t effected at formal value but refrance effected at formal value.
Your Name Your Email-ID
Your Answer
42. What is the difference between string keyword and System.String class?
  String keyword is an alias for System.String class. Therefore, System.String and string keyword are the same, and you can use whichever naming convention you prefer. The String class provides many methods for safely creating, manipulating, and comparing strings.
 
Your Name Your Email-ID
Your Answer
43. What are the two data types available in C#?
 
  • Value type
  • Reference type
 
Your Name Your Email-ID
Your Answer
44. What are the different types of Caching?
 
    There are three types of Caching :
  • Output Caching: stores the responses from an asp.net page.
  • Fragment Caching: Only caches/stores the portion of page (User Control)
  • Data Caching: is Programmatic way to Cache objects for performance.
 
Your Name Your Email-ID
Your Answer
45. What is the difference between Custom Control and User Control?
  Custom Controls are compiled code (Dlls), easier to use, difficult to create, and can be placed in toolbox. Drag and Drop controls. Attributes can be set visually at design time. Can be used by Multiple Applications (If Shared Dlls), Even if Private can copy to bin directory of web application add reference and use. Normally designed to provide common functionality independent of consuming Application.

User Controls are similar to those of ASP include files, easy to create, can not be placed in the toolbox and dragged - dropped from it. A User Control is shared among the single application files.
 
Your Name Your Email-ID
Your Answer