C# Interview Question and Answers

26. What is the difference between const and static readonly?
  The difference is that static read only can be modified by the containing class, but const can never be modified and must e initialized to a compile time constant.
    To expand on the static read only case a bit, the containing class can only modify it:
  • in the variable declaration ( through a variable initialize)
  • in the static constructor (instance constructor if it's not static)
 
Your Name Your Email-ID
Your Answer
27. Is it possible to have a static indexer in C#?
  No. Static indexers are not allowed in C#.
 
Your Name Your Email-ID
Your Answer
28. What namespaces are necessary to create a localized application?
  System.globalization and System.Resources
 
Your Name Your Email-ID
Your Answer
29. How are struts different from classes?
  Structs are stored on the stack as opposed to the heap. Structs are value types rather than reference types.
 
Your Name Your Email-ID
Your Answer
30. Does C# support multiple inheritance?
  C# supports multiple inheritance of interfaces, but not of classes.
 
Your Name Your Email-ID
Your Answer
12345678910 Page 6 of 10