C# fundamentals
- int, double, decimal, string, char, bool are alias.
- Do not compare floating point numbers for equality because of precision. Use Decimal instead.
- Must cast object-type object to proper type before being able to use its method.
- Can call it methods directly if it is dynamic-type object. (Ex: GetType, Length). Use with other language class libraries, or COM (Excel, Word).
- Value types variables are released while reference type variables must wait for garbage collection.
- var local variables can be inferred by suffixing literal values with L, M, D, F; a literal number, string, true/false.
- Value types can also use the new keyword if there is no literals to set the value. Ex: DateTime
Comments
Post a Comment