Visual C# FAQ


Jump to: navigation, search

Visual C# Frequently Asked Questions (FAQs)

Visual C# .NET is factual!
The Visual C# FAQ—Frequently Asked Questions—provides answers to the most common questions asked of our C# and .NET community. These questions address common problems, software upgrades, and special features.

Find answers to conversion, developer, or student project questions. The answers are divided into categories by language. And, you are welcome to add your faq question and answer.

C# and Visual C# FAQs


CSharp Language FAQ

The C# Language FAQ covers frequently asked questions relating to the C# language itself.
  1. Are C# constructors inherited?
  2. Are C# parameters passed by reference or by value ?
  3. Can a property have different get and set access?
  4. Can const and static be used together?
  5. Can I directly call a native function exported from a DLL?
  6. Do unused references to external assemblies lead to code bloat?
  7. Does C# have its own class library?
  8. Does C# have macros or a preprocessor?
  9. Does C# support custom exceptions?
  10. Does C# support jagged arrays?
  11. Does C# support variable method arguments (vararg)?
  12. How call overloaded operators from non-supporting languages?
  13. How can I force garbage collection?
  14. How can I output simple debugging messages?
  15. How can one constructor call another?
  16. How check the object type at runtime?
  17. How can type name clashes be resolved?
  18. How do destructors work in C#?
  19. How do I declare an out variable?
  20. How do I get DllImport to work?
  21. How do I make a C# DLL?
  22. How do I use trace and assert?
  23. How get the type name at runtime?
  24. How keep a local variable in scope across a try-catch block?
  25. How make sure C# classes will interoperate with other .NET languages?
  26. How perform a case insensitive string comparison?
  27. How process command line arguments?
  28. How specify a C# literal type?
  29. How subscribe to events exposed by remoted objects?
  30. How to obtain type information on the fly using typeof?
  31. How use an alias for a class or namespace?
  32. How would I create a Delegate or MulticastDelegate?
  33. Is there C# support for C-type macros?
  34. Is there C# support for templates?
  35. What are the C# character escape sequences (\)?
  36. What does at sign (@) identifier mean?
  37. What does "Object reference not set to an instance of an object" mean?
  38. What is a namespace?
  39. What is a type alias?
  40. What is C#?
  41. What is a C# response file?
  42. What is a verbatim string literal (@)?
  43. What is the C# Language Specification?
  44. What is the #define preprocessor directive?
  45. What is the difference between const and static readonly?
  46. What is the difference between delegate and event?
  47. What is the difference between GetType() and typeof?
  48. What is the difference between new and override?
  49. What is the difference between the out and ref parameter modifiers?
  50. What is the difference between string and System.String?
  51. What is the difference between using a cast and the as operator?
  52. What is the syntax for calling an overloaded constructor from within a constructor?
  53. What is the use of the C# compiler's /target: command line option?
  54. What is the Windows Class Viewer?
  55. What software is needed to develop C# applications?
  56. When should an exception be thrown?
  57. When should Equals and == be used?
  58. Will Console.WriteLine() stop printing upon encountering a NULL character in a string?
  59. Why add a using statement and a reference?
  60. Why are hashtable lookups so slow with struct keys?
  61. Why do I get a syntax error when I try to declare a variable named checked?
  62. Why does C# not support checked exceptions?
  63. Why does my Windows application open a console window each time it is run?
  64. Why doesn't the C# switch statement work like I expect it to?
  65. Why doesn't a Windows Form project use visual styles in XP?
  66. Why get an error (CS1006) when declaring a method without a return type?
  67. Why must struct constructors have at least one argument?


Visual CSharp and .NET FAQ

The Visual C# Language and .NET FAQ covers frequently asked questions relating to the Visual C# system which includes the C# language and the Visual Studio .NET development system for C#.
  1. Am I missing an assembly reference?
  2. Are .NET generics like C++ templates?
  3. Are there free .NET decompilers?
  4. Does .NET run only on Windows?
  5. How call a method using a name string?
  6. How convert a string type to an int type?
  7. How create an instance of a type using only its name?
  8. How display int as a binary number, a string of 0s and 1s?
  9. How enforce coding guidelines for custom .NET assemblies?
  10. How ensure that only one instance of an application will run?
  11. How get assembly attributes at runtime?
  12. How good are .NET decompilers?
  13. How protect .NET code against decompilation?
  14. How protect .NET code from reverse engineering?
  15. How start another program from .NET?
  16. How to read files with accented characters?
  17. Is there a .NET equivalent to regsvr32?
  18. Must the framework be installed to run .NET applications?
  19. Should calling Initialize() on a reference type array fill it with objects?
  20. What about .NET decompilers that allow code to be submitted from browsers?
  21. What compression and zipping capabilities does .NET have?
  22. What do all the .NET acronyms mean?
  23. What does a .NET decompiler do?
  24. What is .NET?
  25. What is the difference between Convert.ToInt32(string) and Int32.Parse(string)?
  26. What is the easiest way to fetch a Web page in .NET?
  27. Why does .NET make arithmetic errors?


Visual CSharp and C FAQ

The Visual C# and C FAQ covers frequently asked questions about Visual C# as it relates to the C language.
  1. How can I declare inout arguments in C#?


Visual CSharp and Cplusplus FAQ

The Visual C# and C++ FAQ covers frequently asked questions about Visual C# as it relates to the C++ language.
  1. Are .NET generics like C++ templates?
  2. Are all C# methods virtual?
  3. Are constructors the same in C++ and C#?
  4. Are destructors the same in C++ and C#?
  5. Are references the same in C++ and C#?
  6. Are standard types the same in C++ and C#?
  7. Are structs the same in C++ and C#?
  8. Does C# check array bounds? (array bounds checking)
  9. Does C# have global methods?
  10. Does C# have multiple inheritance like C++?
  11. Does C# replace C++?
  12. How call a virtual method from a constructor or destructor?
  13. How declare a pure virtual function in C#?
  14. How enforce constructor correctness in C#?
  15. How make a C# destructor virtual?
  16. Is a C++ abstract class like a C# interface?
  17. Is typedef available in C#?
  18. What are the differences between C# and C++ inheritance syntax?


Visual CSharp and Database FAQ

The Visual C# and Database FAQ covers frequently asked questions about Visual C# as it relates to database topics, e.g. ADO.NET.
  1. How escape text in SQL statements?
  2. How express dates and times in SQL statements?
  3. What is the difference between Close and Dispose?


Visual CSharp and Java Language FAQ

The Visual C# and Java Language FAQ covers frequently asked questions about Visual C# as it relates to the Java language.
  1. Are C# classes allocated on the heap?
  2. Are C# strings immutable?
  3. Does C# have a throws clause?
  4. Does C# support boxing?
  5. Does C# support final classes?
  6. Does C# support jagged arrays?
  7. Does C# support static initialization blocks?
  8. How do Java and C# objects compare?
  9. What are the differences between C# and Java access modifiers?
  10. What are the differences between C# and Java constant declarations?
  11. What are the differences between C# and Java constructors?
  12. What are the differences between C# and Java exceptions?
  13. What are the differences between C# and Java garbage collection?
  14. What are the differences between C# and Java generics?
  15. What are the differences between C# and Java inheritance syntax?
  16. What are the differences between C# and Java keywords?
  17. What are the differences between C# and Java Main methods?
  18. What are the differences between C# and Java member initialization?
  19. What are the differences between C# and Java primitive types?
  20. What are the differences between C# and Java reflection?
  21. What are the differences between C# and Java runtimes?
  22. What are the differences between C# and Java variable length parameter lists?
  23. What are the differences between C# and Java virtual machines?
  24. What are the differences between C# finalizers and Java destructors?
  25. What is the difference between C# and Java array declarations?
  26. What is the difference between C# and Java constructor chaining?
  27. What is the difference between C# and Java enumerations (enum)?
  28. What is the difference between C# and Java foreach loops?
  29. What is the difference between C# and Java threads?
  30. What is the difference between C# lock and Java synchronized?
  31. What is the difference between C# using and Java package?
  32. What is the difference between calling base class constructors in C# and Java?
  33. What is the difference between metadata annotations in C# and Java?
  34. What is the difference between nested classes in C# and Java?


Visual CSharp and Visual Basic (VB) FAQ

The Visual C# and Visual Basic FAQ covers frequently asked questions about Visual C# as it relates to the Visual Basic (VB) language.
  1. Does C# have with from Visual Basic (VB)?
  2. How do I convert or upgrade my Visual Basic (VB) application to a C# application?
  3. How get the rightmost part of a string?
  4. What is the C# equivalent of addressof in VB?
  5. What is the C# equivalent of Me in VB?
  6. What is the C# equivalent of MyBase in VB?
  7. What is the C# equivalent of MyClass in VB?
  8. What is the C# equivalent of Nothing in VB?
  9. Why choose C# over Visual Basic (VB)?


Visual CSharp and Visual Jplusplus FAQ

The Visual C# and Visual J++ FAQ covers frequently asked questions about Visual C# as it relates to the obsolete J++ language.
  1. How can I port synchronized functions from Visual J++ to C#?
  2. What is the C# equivalent of the J++ instanceof operator?


Visual CSharp and Windows Forms FAQ

The Visual C# and Windows Forms FAQ covers frequently asked questions about Visual C# as it relates to the Windows Forms package.
  1. How To: Monitor changes to Clipboard contents?
  2. How To: Pass parameters from one form to another?
  3. How To: Paste plain text into a RichTextBox?
  4. How To: Set the background of an MDI container window?


See also


Share this page
  • del.icio.us
  • Facebook
  • Google+
  • StumbleUpon