lect8 - Yin Lou CS 2026 Spring 2010 Reflection Conversion...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Yin Lou CS 2026, Spring 2010 Reflection Conversion Explicit and implicit conversions User-defined conversions Exceptions Checked & Unchecked C# 3.0 features Two contexts for evaluating arithmetic Unchecked Default context Overflows do not throw exceptions Use unchecked operator to make explicit Checked Overflows throw System.OverflowException Use checked operator double d = double.MaxValue; unchecked { int a = (int) d; } Some of C# 3.0 language features Implicitly typed variables Automatic properties Initializers Anonymous types Lambda expressions Extension methods High level points Less (finger) typing → shorter programs → fewer bugs Better functional programming features LINQ: language-integrated query E.g. Select items with more than 5 letters string videoGames = {"Morrowind", "BioShock", "Half Life 2: Episode 1", "The Darkness"}; IEnumerable<string> subset = from g in videoGames where g.Length > 10 orderby g select g;...
View Full Document

{[ snackBarMessage ]}

Page1 / 16

lect8 - Yin Lou CS 2026 Spring 2010 Reflection Conversion...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online