chap 1

I have finished reading the first chapter, and following are my notes

  • using directive directly inside the namespace is invalid
  • using directive statements are not commulative
  • a class not nested in any namespace is in the global namespace
  • namespaces can be nested
  • Main is entry point a C# program and Main can be in a class or a struct
  • Main method can be private
  • Main method cannot be overloaded
  • If there are multiple classes with Main method then you can set startup in the project properties
  • the default exit code for an application is zero,The exit code of a process is stored in the Process Environment Block (PEB) and readable through the GetExitCodeProcess API.
  • ? to declare a Nullable <T> type
  • Read here to understand why Nullable type struct was introduced
  • ?? to check for null value
  • C# switch does not allow cascading between switch case statements, it is only allowed if case does not have any statements defined
  • switch(k) where k can be int, char, enum or string type or any object, value or ref which can be converted to these types
  • The foreach statement confirms that the enumerator or elements of the collection are disposable objects. If so, the foreach statement calls the Dispose method on the applicable objects. Disposable objects implement the IDisposable interface.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: