<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7056431372202946395</id><updated>2012-02-16T05:27:19.053-08:00</updated><title type='text'>Miner's Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://logicminer.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7056431372202946395/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://logicminer.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Logic Miner</name><uri>http://www.blogger.com/profile/14179914684731051968</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_WXl-XZtptdc/S79pnIImIsI/AAAAAAAAAAM/4itCcD4Nluw/S220/Image013.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7056431372202946395.post-3725105391996862984</id><published>2010-06-23T22:11:00.001-07:00</published><updated>2011-01-19T09:03:30.414-08:00</updated><title type='text'>ILViewer</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;This is an Add-in to Visual Studio&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="line-height: 115%; font-family: &amp;quot;Cambria&amp;quot;,&amp;quot;serif&amp;quot;; color: #00b0f0; font-size: 13pt; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin"&gt;Description &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;This helps us to view the MSIL (Microsoft Intermediate Language) generated for C# or VB.Net code we write. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="line-height: 115%; font-family: &amp;quot;Cambria&amp;quot;,&amp;quot;serif&amp;quot;; color: #00b0f0; font-size: 13pt; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin"&gt;Expected&lt;/span&gt;&lt;/b&gt;&lt;span style="mso-no-proof: yes"&gt; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="line-height: 115%; font-family: &amp;quot;Cambria&amp;quot;,&amp;quot;serif&amp;quot;; color: #00b0f0; font-size: 13pt; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin"&gt;Users&lt;/span&gt;&lt;/b&gt;&lt;span style="mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;Those who are interested in studying -&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; How compiler is handling your code? &lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; How new language&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;features are implemented? &lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="line-height: 115%; font-family: &amp;quot;Cambria&amp;quot;,&amp;quot;serif&amp;quot;; color: #00b0f0; font-size: 13pt; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin"&gt;Example&lt;/span&gt;&lt;/b&gt;&lt;span style="mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;What is the MSIL equivalent for ‘property’ in C# or VB.Net?&lt;/p&gt;&lt;blockquote&gt;  &lt;p class="MsoNormal"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; When you write a property in C#, compiler is generating some methods corresponding to it. Eventhough .property is there, the get_property and set_property methods are the working methods&lt;/p&gt;&lt;/blockquote&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; i&lt;/span&gt;e, &lt;/p&gt;&lt;blockquote&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;; color: blue; font-size: 10pt; mso-no-proof: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public&lt;/span&gt;&lt;span style="line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; mso-no-proof: yes"&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; Text { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; } is – &lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 800px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  1: .property &lt;span style="color: #0000ff"&gt;instance&lt;/span&gt; string Text()&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  2:  {&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  3:    .get &lt;span style="color: #0000ff"&gt;instance&lt;/span&gt; string Game.Classes.Dragger::get_Text()&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  4:    .set &lt;span style="color: #0000ff"&gt;instance&lt;/span&gt; void Game.Classes.Dragger::set_Text(string)&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  5:  }&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  6: &lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  7:  .&lt;span style="color: #0000ff"&gt;method&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;hidebysig&lt;/span&gt; &lt;span style="color: #0000ff"&gt;specialname&lt;/span&gt; &lt;span style="color: #0000ff"&gt;instance&lt;/span&gt; string &lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  8:          get_Text() &lt;span style="color: #0000ff"&gt;cil&lt;/span&gt; &lt;span style="color: #0000ff"&gt;managed&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  9:  {&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 10:    .&lt;span style="color: #0000ff"&gt;custom&lt;/span&gt; &lt;span style="color: #0000ff"&gt;instance&lt;/span&gt; void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) &lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 11:    &lt;span style="color: #008000"&gt;// Code size       11 (0xb)&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 12:    .maxstack  1&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 13:    .locals &lt;span style="color: #0000ff"&gt;init&lt;/span&gt; (string V_0)&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 14:    IL_0000:  &lt;span style="color: #0000ff"&gt;ldarg&lt;/span&gt;.0&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 15:    IL_0001:  &lt;span style="color: #0000ff"&gt;ldfld&lt;/span&gt;      string Game.Classes.Dragger::'&amp;lt;Text&amp;gt;k__BackingField'&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 16:    IL_0006:  stloc.0&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 17:    IL_0007:  &lt;span style="color: #0000ff"&gt;br&lt;/span&gt;.s       IL_0009 &lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 18: &lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 19:    IL_0009:  &lt;span style="color: #0000ff"&gt;ldloc&lt;/span&gt;.0&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 20:    IL_000a:  &lt;span style="color: #0000ff"&gt;ret&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 21:  } &lt;span style="color: #008000"&gt;// end of method Dragger::get_Text &lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 22: &lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 23:  .&lt;span style="color: #0000ff"&gt;method&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;hidebysig&lt;/span&gt; &lt;span style="color: #0000ff"&gt;specialname&lt;/span&gt; &lt;span style="color: #0000ff"&gt;instance&lt;/span&gt; void &lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 24:          set_Text(string 'value') &lt;span style="color: #0000ff"&gt;cil&lt;/span&gt; &lt;span style="color: #0000ff"&gt;managed&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 25:  {&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 26:    .&lt;span style="color: #0000ff"&gt;custom&lt;/span&gt; &lt;span style="color: #0000ff"&gt;instance&lt;/span&gt; void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) &lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 27:    &lt;span style="color: #008000"&gt;// Code size       8 (0x8)&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 28:    .maxstack  8&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 29:    IL_0000:  &lt;span style="color: #0000ff"&gt;ldarg&lt;/span&gt;.0&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 30:    IL_0001:  &lt;span style="color: #0000ff"&gt;ldarg&lt;/span&gt;.1&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 31:    IL_0002:  &lt;span style="color: #0000ff"&gt;stfld&lt;/span&gt;      string Game.Classes.Dragger::'&amp;lt;Text&amp;gt;k__BackingField'&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 32:    IL_0007:  &lt;span style="color: #0000ff"&gt;ret&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 33:  } &lt;span style="color: #008000"&gt;// end of method Dragger::set_Text&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 34: &lt;/pre&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;Ie, for set and get methods with set_propertyName and get_propertyName are generated.&lt;/p&gt;&lt;p class="MsoNormal"&gt;When you say – &lt;span style="line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; mso-no-proof: yes"&gt;Text=”Hello”, compiler is doing – set_Text(“Hello”)&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="line-height: 115%; font-family: &amp;quot;Cambria&amp;quot;,&amp;quot;serif&amp;quot;; color: #00b0f0; font-size: 13pt; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin"&gt;Use&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;Download ILViewer from &lt;a href="http://ilviewer.codeplex.com/releases/view/59437"&gt;http://ilviewer.codeplex.com/releases/view/59437&lt;/a&gt; and install it.&lt;/p&gt;&lt;p style="text-indent: 0.5in" class="MsoNormal"&gt;&lt;span style="mso-no-proof: yes"&gt;Now you will&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;be able to see this plug in Visual Studio ‘Tools’ menu &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof: yes"&gt;&lt;a href="http://lh3.ggpht.com/_ImGelcsF0JE/TCLozLx8QAI/AAAAAAAAABE/tdyhY1V3ho0/s1600-h/clip_image002%5B20%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://lh4.ggpht.com/_ImGelcsF0JE/TCLozkt3WMI/AAAAAAAAABI/V9L0u86EGJ4/clip_image002_thumb%5B4%5D.jpg?imgmax=800" width="244" height="41" v:shapes="Picture_x0020_4" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof: yes"&gt;Provide a shortcut key for ILViewer as – &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;Go to: Tools =&amp;gt; Environment =&amp;gt; Keyboard &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;Select ILViewer and provide shortcut key to be used. I am using ‘Ctrl+I’ &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;a href="http://lh4.ggpht.com/_ImGelcsF0JE/TCLo0FPxiGI/AAAAAAAAABM/uIPZWnxA2eg/s1600-h/clip_image004%5B20%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://lh3.ggpht.com/_ImGelcsF0JE/TCLo1GY0niI/AAAAAAAAABQ/C6QIuWEJuXE/clip_image004_thumb%5B4%5D.jpg?imgmax=800" width="244" height="143" v:shapes="Picture_x0020_7" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Open a .cs or .vb file in Visual Studio and run the ILViewer (press your shortcut key for ILViewer).&lt;/p&gt;&lt;p class="MsoNormal"&gt;Now you can see the IL generated for your code file as a new file opened in Visual Studio.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof: yes"&gt;&lt;a href="http://lh5.ggpht.com/_ImGelcsF0JE/TCLo1s0ow9I/AAAAAAAAABU/EsBXjfc81-I/s1600-h/clip_image006%5B20%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image006" border="0" alt="clip_image006" src="http://lh3.ggpht.com/_ImGelcsF0JE/TCLo1xytlTI/AAAAAAAAABY/k2KKYrxYmfY/clip_image006_thumb%5B4%5D.jpg?imgmax=800" width="244" height="130" v:shapes="Picture_x0020_8" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Now you can select ‘New Horizonrtal Tab Group’ option from Windows menu. &lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof: yes"&gt;&lt;a href="http://lh4.ggpht.com/_ImGelcsF0JE/TCLo2fUQYuI/AAAAAAAAABc/dq-n22kIJsE/s1600-h/clip_image008%5B20%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image008" border="0" alt="clip_image008" src="http://lh3.ggpht.com/_ImGelcsF0JE/TCLo2wcBS4I/AAAAAAAAABg/k-DFa2bVJyU/clip_image008_thumb%5B4%5D.jpg?imgmax=800" width="151" height="244" v:shapes="Picture_x0020_9" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;This will create two windows: one for C# or VB.Net code and the other for IL.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof: yes"&gt;&lt;a href="http://lh6.ggpht.com/_ImGelcsF0JE/TCLo3H8H-yI/AAAAAAAAABk/jxuJgZhNDCs/s1600-h/clip_image010%5B20%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image010" border="0" alt="clip_image010" src="http://lh4.ggpht.com/_ImGelcsF0JE/TCLo4GRRxdI/AAAAAAAAABo/pkLeVmtHkVk/clip_image010_thumb%5B4%5D.jpg?imgmax=800" width="244" height="196" v:shapes="Picture_x0020_10" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;After making changes in C# code, click short key for ILViewer and see the MSIL getting changed in lower pane.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="line-height: 115%; font-family: &amp;quot;Cambria&amp;quot;,&amp;quot;serif&amp;quot;; color: red; font-size: 13pt"&gt;Note&lt;/span&gt;&lt;/b&gt;:&lt;/p&gt;&lt;p style="text-indent: -0.25in; margin-left: 73.5pt; mso-add-space: auto; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&lt;span style="mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;1.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Whenever ILViewer is running, the focus should be in .cs or .vb file. Else you will get an error message as follows –&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof: yes"&gt;&lt;a href="http://lh6.ggpht.com/_ImGelcsF0JE/TCg3fSocIqI/AAAAAAAAACU/XRUcpxYZzlc/s1600-h/clip_image002%5B6%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://lh4.ggpht.com/_ImGelcsF0JE/TCg3gKJnkUI/AAAAAAAAACY/LeiJZErm-7c/clip_image002_thumb%5B1%5D.jpg?imgmax=800" width="244" height="43" v:shapes="Picture_x0020_13" /&gt;&lt;/a&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p style="text-indent: -0.25in; margin-left: 73.5pt; mso-add-space: auto; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&lt;span style="mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;2.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 115%; color: #333333; font-size: 7pt"&gt;&amp;#160; &lt;/span&gt;&lt;span style="color: #333333"&gt;Make sure that your &lt;span style="line-height: 115%; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: #333333; font-size: 11pt; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-fareast-font-family: calibri; mso-ansi-language: en-us; mso-fareast-language: en-us; mso-bidi-language: ar-sa"&gt;code &lt;/span&gt;&lt;span style="line-height: 115%; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: red; font-size: 11pt; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-fareast-font-family: calibri; mso-ansi-language: en-us; mso-fareast-language: en-us; mso-bidi-language: ar-sa"&gt;file doesn’t have any partial class, whose partial definition is in some other file&lt;/span&gt; . This results in compilation error.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Happy Learning&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7056431372202946395-3725105391996862984?l=logicminer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://logicminer.blogspot.com/feeds/3725105391996862984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logicminer.blogspot.com/2010/06/ilviewer.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7056431372202946395/posts/default/3725105391996862984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7056431372202946395/posts/default/3725105391996862984'/><link rel='alternate' type='text/html' href='http://logicminer.blogspot.com/2010/06/ilviewer.html' title='ILViewer'/><author><name>Logic Miner</name><uri>http://www.blogger.com/profile/14179914684731051968</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_WXl-XZtptdc/S79pnIImIsI/AAAAAAAAAAM/4itCcD4Nluw/S220/Image013.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_ImGelcsF0JE/TCLozkt3WMI/AAAAAAAAABI/V9L0u86EGJ4/s72-c/clip_image002_thumb%5B4%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7056431372202946395.post-3174113600411328014</id><published>2010-06-07T23:22:00.001-07:00</published><updated>2010-06-07T23:22:58.421-07:00</updated><title type='text'>Transformation of delegates to Lambda</title><content type='html'>&lt;meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /&gt;&lt;meta content="Word.Document" name="ProgId" /&gt;&lt;meta content="Microsoft Word 12" name="Generator" /&gt;&lt;meta content="Microsoft Word 12" name="Originator" /&gt;&lt;link href="Lambda_files/filelist.xml" rel="File-List" /&gt;&lt;link href="Lambda_files/editdata.mso" rel="Edit-Time-Data" /&gt;&lt;style&gt;v\:* {behavior:url(#default#VML);}o\:* {behavior:url(#default#VML);}w\:* {behavior:url(#default#VML);}.shape {behavior:url(#default#VML);}&lt;/style&gt;&lt;link href="Lambda_files/themedata.thmx" rel="themeData" /&gt;&lt;link href="Lambda_files/colorschememapping.xml" rel="colorSchemeMapping" /&gt;&lt;style&gt;&lt;!-- /* Font Definitions */ @font-face	{font-family:"Cambria Math";	panose-1:2 4 5 3 5 4 6 3 2 4;	mso-font-charset:0;	mso-generic-font-family:roman;	mso-font-pitch:variable;	mso-font-signature:-1610611985 1107304683 0 0 159 0;}@font-face	{font-family:calibri;	panose-1:2 15 5 2 2 2 4 3 2 4;	mso-font-charset:0;	mso-generic-font-family:swiss;	mso-font-pitch:variable;	mso-font-signature:-1610611985 1073750139 0 0 159 0;}@font-face	{font-family:tahoma;	panose-1:2 11 6 4 3 5 4 4 2 4;	mso-font-charset:0;	mso-generic-font-family:swiss;	mso-font-pitch:variable;	mso-font-signature:1627400839 -2147483648 8 0 66047 0;} /* Style Definitions */ p.msonormal, li.msonormal, div.msonormal	{mso-style-unhide:no;	mso-style-qformat:yes;	mso-style-parent:"";	margin-top:0in;	margin-right:0in;	margin-bottom:10.0pt;	margin-left:0in;	line-height:115%;	mso-pagination:widow-orphan;	font-size:11.0pt;	font-family:"Calibri","sans-serif";	mso-ascii-font-family:calibri;	mso-ascii-theme-font:minor-latin;	mso-fareast-font-family:calibri;	mso-fareast-theme-font:minor-latin;	mso-hansi-font-family:calibri;	mso-hansi-theme-font:minor-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:minor-bidi;}h1	{mso-style-priority:9;	mso-style-unhide:no;	mso-style-qformat:yes;	mso-style-link:"Heading 1 Char";	mso-style-next:normal;	margin-top:24.0pt;	margin-right:0in;	margin-bottom:0in;	margin-left:0in;	margin-bottom:.0001pt;	line-height:115%;	mso-pagination:widow-orphan lines-together;	page-break-after:avoid;	mso-outline-level:1;	font-size:14.0pt;	font-family:"Cambria","serif";	mso-ascii-font-family:cambria;	mso-ascii-theme-font:major-latin;	mso-fareast-font-family:"Times New Roman";	mso-fareast-theme-font:major-fareast;	mso-hansi-font-family:cambria;	mso-hansi-theme-font:major-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:major-bidi;	color:#365f91;	mso-themecolor:accent1;	mso-themeshade:191;	mso-font-kerning:0pt;}h2	{mso-style-priority:9;	mso-style-qformat:yes;	mso-style-link:"Heading 2 Char";	mso-style-next:normal;	margin-top:10.0pt;	margin-right:0in;	margin-bottom:0in;	margin-left:0in;	margin-bottom:.0001pt;	line-height:115%;	mso-pagination:widow-orphan lines-together;	page-break-after:avoid;	mso-outline-level:2;	font-size:13.0pt;	font-family:"Cambria","serif";	mso-ascii-font-family:cambria;	mso-ascii-theme-font:major-latin;	mso-fareast-font-family:"Times New Roman";	mso-fareast-theme-font:major-fareast;	mso-hansi-font-family:cambria;	mso-hansi-theme-font:major-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:major-bidi;	color:#4f81bd;	mso-themecolor:accent1;}h3	{mso-style-priority:9;	mso-style-qformat:yes;	mso-style-link:"Heading 3 Char";	mso-style-next:normal;	margin-top:10.0pt;	margin-right:0in;	margin-bottom:0in;	margin-left:0in;	margin-bottom:.0001pt;	line-height:115%;	mso-pagination:widow-orphan lines-together;	page-break-after:avoid;	mso-outline-level:3;	font-size:11.0pt;	font-family:"Cambria","serif";	mso-ascii-font-family:cambria;	mso-ascii-theme-font:major-latin;	mso-fareast-font-family:"Times New Roman";	mso-fareast-theme-font:major-fareast;	mso-hansi-font-family:cambria;	mso-hansi-theme-font:major-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:major-bidi;	color:#4f81bd;	mso-themecolor:accent1;}p.msoacetate, li.msoacetate, div.msoacetate	{mso-style-noshow:yes;	mso-style-priority:99;	mso-style-link:"Balloon Text Char";	margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:8.0pt;	font-family:"Tahoma","sans-serif";	mso-fareast-font-family:calibri;	mso-fareast-theme-font:minor-latin;}span.heading1char	{mso-style-name:"Heading 1 Char";	mso-style-priority:9;	mso-style-unhide:no;	mso-style-locked:yes;	mso-style-link:"Heading 1";	mso-ansi-font-size:14.0pt;	mso-bidi-font-size:14.0pt;	font-family:"Cambria","serif";	mso-ascii-font-family:cambria;	mso-ascii-theme-font:major-latin;	mso-fareast-font-family:"Times New Roman";	mso-fareast-theme-font:major-fareast;	mso-hansi-font-family:cambria;	mso-hansi-theme-font:major-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:major-bidi;	color:#365f91;	mso-themecolor:accent1;	mso-themeshade:191;	font-weight:bold;}span.heading2char	{mso-style-name:"Heading 2 Char";	mso-style-priority:9;	mso-style-unhide:no;	mso-style-locked:yes;	mso-style-link:"Heading 2";	mso-ansi-font-size:13.0pt;	mso-bidi-font-size:13.0pt;	font-family:"Cambria","serif";	mso-ascii-font-family:cambria;	mso-ascii-theme-font:major-latin;	mso-fareast-font-family:"Times New Roman";	mso-fareast-theme-font:major-fareast;	mso-hansi-font-family:cambria;	mso-hansi-theme-font:major-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:major-bidi;	color:#4f81bd;	mso-themecolor:accent1;	font-weight:bold;}span.heading3char	{mso-style-name:"Heading 3 Char";	mso-style-priority:9;	mso-style-unhide:no;	mso-style-locked:yes;	mso-style-link:"Heading 3";	font-family:"Cambria","serif";	mso-ascii-font-family:cambria;	mso-ascii-theme-font:major-latin;	mso-fareast-font-family:"Times New Roman";	mso-fareast-theme-font:major-fareast;	mso-hansi-font-family:cambria;	mso-hansi-theme-font:major-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:major-bidi;	color:#4f81bd;	mso-themecolor:accent1;	font-weight:bold;}span.balloontextchar	{mso-style-name:"Balloon Text Char";	mso-style-noshow:yes;	mso-style-priority:99;	mso-style-unhide:no;	mso-style-locked:yes;	mso-style-link:"Balloon Text";	mso-ansi-font-size:8.0pt;	mso-bidi-font-size:8.0pt;	font-family:"Tahoma","sans-serif";	mso-ascii-font-family:tahoma;	mso-hansi-font-family:tahoma;	mso-bidi-font-family:tahoma;}.msochpdefault	{mso-style-type:export-only;	mso-default-props:yes;	mso-ascii-font-family:calibri;	mso-ascii-theme-font:minor-latin;	mso-fareast-font-family:calibri;	mso-fareast-theme-font:minor-latin;	mso-hansi-font-family:calibri;	mso-hansi-theme-font:minor-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:minor-bidi;}.msopapdefault	{mso-style-type:export-only;	margin-bottom:10.0pt;	line-height:115%;}@page section1	{size:8.5in 11.0in;	margin:1.0in 1.0in 1.0in 1.0in;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.section1	{page:section1;}--&gt;&lt;/style&gt;&lt;div class="Section1"&gt;  &lt;h1 style="text-align: center" align="center"&gt;&lt;span style="font-size: 11pt; line-height: 115%; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;Lambda expressions are equivalent to delegates that we are using. To see how lambda expressions evolved, we have to start from basics –&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;C# 1.1 creating delegates &lt;/span&gt;&lt;/h3&gt;&lt;/div&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1:   1: &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; Generics&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  2:   2: {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  3:   3: &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  4:   4:     &lt;span style="color: #008000"&gt;//Declare delegate&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  5:   5:     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;delegate&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Message(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; message); &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  6:   6: &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  7:   7:     &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Lambda&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  8:   8:     {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  9:   9:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Message myMessage { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&lt;/span&gt;; }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt; 10:  10:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Lambda()&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt; 11:  11:         {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt; 12:  12:             &lt;span style="color: #008000"&gt;//Define delegate&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt; 13:  13:             myMessage = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Message(MessageLogic);&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt; 14:  14:             &lt;span style="color: #008000"&gt;//Invoke delegate&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt; 15:  15:             myMessage(&amp;quot;&lt;span style="color: #8b0000"&gt;Hello&lt;/span&gt;&amp;quot;);&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt; 16:  16:         }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt; 17:  17: &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt; 18:  18:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; MessageLogic(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; message)&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt; 19:  19:         {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt; 20:  20:             Console.WriteLine(message);&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt; 21:  21:         }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt; 22:  22:     }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt; 23:  23: &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt; 24:  24: }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt; 25:  25: &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt; 26:  26: &lt;/pre&gt;&lt;/pre&gt;&lt;div class="Section1"&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;When we declare – &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;delegate&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Message&lt;/span&gt;(&lt;span style="color: blue"&gt;string&lt;/span&gt; message); &lt;/span&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Compiler is declaring (generating) a type ‘&lt;span style="color: #2b91af"&gt;Message&lt;/span&gt;’ which inherits from class ‘&lt;span style="color: #2b91af"&gt;Delegate&lt;/span&gt;’. In this class an &lt;b style="mso-bidi-font-weight: normal"&gt;invoke&lt;/b&gt; method will be defined with the signature we are providing in the declaration line (In our case it is a &lt;span style="color: blue"&gt;void&lt;/span&gt; method that accepts a &lt;span style="color: blue"&gt;string&lt;/span&gt;). &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Our focus is on line –&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;myMessage = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Message&lt;/span&gt;(MessageLogic); &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;This definition actually instantiates the class declared by compiler and passes the address of method, that suits the delegate signature, to the constructor &lt;/span&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;C# 2.0 delegates inference &lt;/span&gt;&amp;#160;&lt;/h3&gt;  &lt;p class="MsoNormal"&gt;We can declare delegate as -&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color: #2b91af; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Message&lt;/span&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; myMessage = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Message&lt;/span&gt;(MessageLogic); &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;But from the variable’s ‘myMessage’ type (here it is &lt;span style="color: #2b91af; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Message&lt;/span&gt;), compiler can infer the type of delegate to be passed. So we can avoid specifying it explicitly – &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color: #2b91af; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Message&lt;/span&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; myMessage = MessageLogic; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;C# 2.0 anonymous methods &lt;/span&gt;&lt;/h3&gt;  &lt;p class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;In above example –&lt;/p&gt;  &lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: Message myMessage = MessageLogic; &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  2: &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; MessageLogic(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; message) &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  3: { &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  4:    Console.WriteLine(message); &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  5: } &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  6: &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  7: &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  8: &lt;/pre&gt;&lt;/pre&gt;  &lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;/span&gt;  &lt;p class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;When we use anonymous method, we are defining the method on the fly- &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color: #2b91af; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Message&lt;/span&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; myMessage = &lt;span style="color: blue"&gt;delegate&lt;/span&gt;(&lt;span style="color: blue"&gt;string&lt;/span&gt; message) { &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(message); }; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Using this statement, compiler generates a method with the definition provided and create a delegate for it and assigns it to the variable ‘myMessage’ used. &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;C# 3.5 lambda expressions &lt;/span&gt;&lt;/h3&gt;  &lt;p class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;In anonymous method – &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color: #2b91af; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Message&lt;/span&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; myMessage = &lt;span style="color: blue"&gt;delegate&lt;/span&gt;(&lt;span style="color: blue"&gt;string&lt;/span&gt; message) { &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(message); }; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;When we use lambda expression we don’t have to use keyword ‘delegate’ and compiler knows it is going to be a delegate &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color: #2b91af; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Message&lt;/span&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; myMessage = (&lt;span style="color: blue"&gt;string&lt;/span&gt; message) =&amp;gt; { &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(message); }; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;‘=&amp;gt;’ is pronounced as ‘goes to’ &lt;/span&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;C# 3.5 lambda expression type inference &lt;/span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/h3&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color: #2b91af; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Message&lt;/span&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; myMessage = (&lt;span style="color: blue"&gt;string&lt;/span&gt; message) =&amp;gt; { &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(message); }; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;From the variable type (&lt;span style="color: #2b91af; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Message&lt;/span&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;), compiler knows what parameter types are going into the method. So we don’t have to specify the type separately &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color: #2b91af; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Message&lt;/span&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; myMessage = (message) =&amp;gt; { &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(message); }; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;C# 3.5 lambda expression enhancements &lt;/span&gt;&lt;/h3&gt;  &lt;p class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;span style="color: #2b91af; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Message&lt;/span&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; myMessage = (message) =&amp;gt; { &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(message); }; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;If there is only one argument for the method, then we can remove braces –&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color: #2b91af; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Message&lt;/span&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; myMessage = message =&amp;gt; { &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(message); }; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Consider the case as follows – &lt;/span&gt;&lt;/p&gt;  &lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;delegate&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Message(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; message); &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  2: Message myMessage = &lt;span style="color: #0000ff"&gt;delegate&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; message) { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; message.Length; }; &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  3: &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  4: &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  5: &lt;/pre&gt;&lt;/pre&gt;  &lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;/span&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;In this expression there is only one statement in function definition and that is a return statement. So we don’t have to use curly braces and ‘&lt;span style="color: blue"&gt;return’&lt;/span&gt; keyword &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color: #2b91af; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Message&lt;/span&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; myMessage = message =&amp;gt; message.Length; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;Example: &lt;/span&gt;&lt;/h3&gt;  &lt;p class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;span style="color: #2b91af; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;List&lt;/span&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt; list = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt; { &lt;span style="color: #a31515"&gt;&amp;quot;Hello&amp;quot;&lt;/span&gt;, &lt;span style="color: #a31515"&gt;&amp;quot;World&amp;quot;&lt;/span&gt; }; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;From this list I need to filter items contains ‘r’ &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;shapetype id="_x0000_t75"&gt;&lt;stroke&gt;&lt;/stroke&gt;&lt;formulas&gt;&lt;f&gt;&lt;/f&gt;&lt;f&gt;&lt;/f&gt;&lt;f&gt;&lt;/f&gt;&lt;f&gt;&lt;/f&gt;&lt;f&gt;&lt;/f&gt;&lt;f&gt;&lt;/f&gt;&lt;f&gt;&lt;/f&gt;&lt;f&gt;&lt;/f&gt;&lt;f&gt;&lt;/f&gt;&lt;f&gt;&lt;/f&gt;&lt;f&gt;&lt;/f&gt;&lt;f&gt;&lt;/f&gt;&lt;/formulas&gt;&lt;path&gt;&lt;/path&gt;&lt;lock v:ext="edit" aspectratio="t"&gt;&lt;/lock&gt;&lt;/shapetype&gt;&lt;shape id="Picture_x0020_2" style="visibility: visible; width: 431.25pt; height: 43.5pt; mso-wrap-style: square" o:spid="_x0000_i1025"&gt;&lt;imagedata o:title="o:title"&gt;&lt;/imagedata&gt;&lt;bordertop&gt;&lt;/bordertop&gt;&lt;borderleft&gt;&lt;/borderleft&gt;&lt;borderbottom&gt;&lt;/borderbottom&gt;&lt;borderright&gt;&lt;/borderright&gt;&lt;/shape&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://lh4.ggpht.com/_ImGelcsF0JE/TA3hto0Ap6I/AAAAAAAAAA0/u4ysuV8CrvU/s1600-h/Where7.jpg"&gt;&lt;img title="Where" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="78" alt="Where" src="http://lh4.ggpht.com/_ImGelcsF0JE/TA3hvo2sNAI/AAAAAAAAAA8/7ORVaYnc3I0/Where_thumb5.jpg?imgmax=800" width="564" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;You can see that ‘Where’ is accepting a &lt;span style="color: blue"&gt;delegate&lt;/span&gt; of type ‘&lt;span style="color: #2b91af"&gt;Func&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;,&lt;span style="color: blue"&gt;bool&lt;/span&gt;&amp;gt;’. &lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoTableGrid" style="border-top-style: none; border-right-style: none; border-left-style: none; border-collapse: collapse; border-bottom-style: none; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellspacing="0" cellpadding="0" border="1"&gt;&lt;tbody&gt;      &lt;tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes"&gt;        &lt;td style="border-right: black 1pt solid; padding-right: 5.4pt; border-top: black 1pt solid; padding-left: 5.4pt; padding-bottom: 0in; border-left: black 1pt solid; width: 6.65in; padding-top: 0in; border-bottom: black 1pt solid; mso-border-alt: solid black .5pt; mso-border-themecolor: text1" valign="top" width="638"&gt;          &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="color: #2b91af; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Func&lt;/span&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; and &lt;span style="color: #2b91af"&gt;Action&lt;/span&gt; are two delegate types provided by framework. Former can be used for functions (&lt;span style="color: blue"&gt;return&lt;/span&gt; is there) and latter for methods (&lt;span style="color: blue"&gt;void&lt;/span&gt; type) &lt;/span&gt;&lt;/p&gt;        &lt;/td&gt;      &lt;/tr&gt;    &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;So &lt;span style="color: #2b91af; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Func&lt;/span&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;,&lt;span style="color: blue"&gt;bool&lt;/span&gt;&amp;gt; means it is a &lt;span style="color: blue"&gt;delegate&lt;/span&gt; that accepts &lt;span style="color: blue"&gt;string&lt;/span&gt; parameter and &lt;span style="color: blue"&gt;returns&lt;/span&gt; a &lt;span style="color: blue"&gt;bool&lt;/span&gt; value.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color: #2b91af; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;IEnumerable&lt;/span&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt; selectedList = list.Where(i =&amp;gt; i.Contains(&lt;span style="color: #a31515"&gt;&amp;quot;r&amp;quot;&lt;/span&gt;)); &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;We passed delegate as ‘i =&amp;gt; i.Contains(&lt;span style="color: #a31515"&gt;&amp;quot;r&amp;quot;&lt;/span&gt;)’, this means inside the ‘Where’ method, it takes each item in the collection ‘list’ and apply our delegate. From our anonymous method we are returning &lt;span style="color: blue"&gt;true&lt;/span&gt; only for items that contains ’r’. If function returns &lt;span style="color: blue"&gt;true&lt;/span&gt;, that item will be added to the output collection ‘selectedList’. &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;In effect we get a collection with one item ‘World’ &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: 19.2pt"&gt;&lt;span style="font-size: 11pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-no-proof: yes; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin"&gt;So what ever we were doing in the past is actually happening now also. The only difference is compiler exposes some easy ways for us to do things and the head ache of converting it to actual definitions is taken by more intelligent compiler. &lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: 19.2pt"&gt;&lt;span style="font-size: 11pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-no-proof: yes; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin"&gt;We can look forward for more intelligent compiler that reduces developers work. &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7056431372202946395-3174113600411328014?l=logicminer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://logicminer.blogspot.com/feeds/3174113600411328014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logicminer.blogspot.com/2010/06/transformation-of-delegates-to-lambda.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7056431372202946395/posts/default/3174113600411328014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7056431372202946395/posts/default/3174113600411328014'/><link rel='alternate' type='text/html' href='http://logicminer.blogspot.com/2010/06/transformation-of-delegates-to-lambda.html' title='Transformation of delegates to Lambda'/><author><name>Logic Miner</name><uri>http://www.blogger.com/profile/14179914684731051968</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_WXl-XZtptdc/S79pnIImIsI/AAAAAAAAAAM/4itCcD4Nluw/S220/Image013.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_ImGelcsF0JE/TA3hvo2sNAI/AAAAAAAAAA8/7ORVaYnc3I0/s72-c/Where_thumb5.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7056431372202946395.post-3874047121582518259</id><published>2010-06-07T23:07:00.001-07:00</published><updated>2010-06-07T23:07:31.484-07:00</updated><title type='text'>Generics Overview</title><content type='html'>&lt;meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /&gt;&lt;meta content="Word.Document" name="ProgId" /&gt;&lt;meta content="Microsoft Word 12" name="Generator" /&gt;&lt;meta content="Microsoft Word 12" name="Originator" /&gt;&lt;link href="Generics%20Overview_files/filelist.xml" rel="File-List" /&gt;&lt;link href="Generics%20Overview_files/themedata.thmx" rel="themeData" /&gt;&lt;link href="Generics%20Overview_files/colorschememapping.xml" rel="colorSchemeMapping" /&gt;&lt;style&gt;&lt;!-- /* Font Definitions */ @font-face	{font-family:"Cambria Math";	panose-1:2 4 5 3 5 4 6 3 2 4;	mso-font-charset:0;	mso-generic-font-family:roman;	mso-font-pitch:variable;	mso-font-signature:-1610611985 1107304683 0 0 159 0;}@font-face	{font-family:calibri;	panose-1:2 15 5 2 2 2 4 3 2 4;	mso-font-charset:0;	mso-generic-font-family:swiss;	mso-font-pitch:variable;	mso-font-signature:-1610611985 1073750139 0 0 159 0;} /* Style Definitions */ p.msonormal, li.msonormal, div.msonormal	{mso-style-unhide:no;	mso-style-qformat:yes;	mso-style-parent:"";	margin-top:0in;	margin-right:0in;	margin-bottom:10.0pt;	margin-left:0in;	line-height:115%;	mso-pagination:widow-orphan;	font-size:11.0pt;	font-family:"Calibri","sans-serif";	mso-ascii-font-family:calibri;	mso-ascii-theme-font:minor-latin;	mso-fareast-font-family:calibri;	mso-fareast-theme-font:minor-latin;	mso-hansi-font-family:calibri;	mso-hansi-theme-font:minor-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:minor-bidi;}h1	{mso-style-priority:9;	mso-style-unhide:no;	mso-style-qformat:yes;	mso-style-link:"Heading 1 Char";	mso-style-next:normal;	margin-top:24.0pt;	margin-right:0in;	margin-bottom:0in;	margin-left:0in;	margin-bottom:.0001pt;	line-height:115%;	mso-pagination:widow-orphan lines-together;	page-break-after:avoid;	mso-outline-level:1;	font-size:14.0pt;	font-family:"Cambria","serif";	mso-ascii-font-family:cambria;	mso-ascii-theme-font:major-latin;	mso-fareast-font-family:"Times New Roman";	mso-fareast-theme-font:major-fareast;	mso-hansi-font-family:cambria;	mso-hansi-theme-font:major-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:major-bidi;	color:#365f91;	mso-themecolor:accent1;	mso-themeshade:191;	mso-font-kerning:0pt;}h2	{mso-style-priority:9;	mso-style-qformat:yes;	mso-style-link:"Heading 2 Char";	mso-style-next:normal;	margin-top:10.0pt;	margin-right:0in;	margin-bottom:0in;	margin-left:0in;	margin-bottom:.0001pt;	line-height:115%;	mso-pagination:widow-orphan lines-together;	page-break-after:avoid;	mso-outline-level:2;	font-size:13.0pt;	font-family:"Cambria","serif";	mso-ascii-font-family:cambria;	mso-ascii-theme-font:major-latin;	mso-fareast-font-family:"Times New Roman";	mso-fareast-theme-font:major-fareast;	mso-hansi-font-family:cambria;	mso-hansi-theme-font:major-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:major-bidi;	color:#4f81bd;	mso-themecolor:accent1;}h3	{mso-style-priority:9;	mso-style-qformat:yes;	mso-style-link:"Heading 3 Char";	mso-style-next:normal;	margin-top:10.0pt;	margin-right:0in;	margin-bottom:0in;	margin-left:0in;	margin-bottom:.0001pt;	line-height:115%;	mso-pagination:widow-orphan lines-together;	page-break-after:avoid;	mso-outline-level:3;	font-size:11.0pt;	font-family:"Cambria","serif";	mso-ascii-font-family:cambria;	mso-ascii-theme-font:major-latin;	mso-fareast-font-family:"Times New Roman";	mso-fareast-theme-font:major-fareast;	mso-hansi-font-family:cambria;	mso-hansi-theme-font:major-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:major-bidi;	color:#4f81bd;	mso-themecolor:accent1;}h4	{mso-style-priority:9;	mso-style-qformat:yes;	mso-style-link:"Heading 4 Char";	mso-style-next:normal;	margin-top:10.0pt;	margin-right:0in;	margin-bottom:0in;	margin-left:0in;	margin-bottom:.0001pt;	line-height:115%;	mso-pagination:widow-orphan lines-together;	page-break-after:avoid;	mso-outline-level:4;	font-size:11.0pt;	font-family:"Cambria","serif";	mso-ascii-font-family:cambria;	mso-ascii-theme-font:major-latin;	mso-fareast-font-family:"Times New Roman";	mso-fareast-theme-font:major-fareast;	mso-hansi-font-family:cambria;	mso-hansi-theme-font:major-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:major-bidi;	color:#4f81bd;	mso-themecolor:accent1;	font-style:italic;}pre	{mso-style-priority:99;	mso-style-link:"HTML Preformatted Char";	margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:10.0pt;	font-family:"Courier New";	mso-fareast-font-family:"Times New Roman";}p.msolistparagraph, li.msolistparagraph, div.msolistparagraph	{mso-style-priority:34;	mso-style-unhide:no;	mso-style-qformat:yes;	margin-top:0in;	margin-right:0in;	margin-bottom:10.0pt;	margin-left:.5in;	mso-add-space:auto;	line-height:115%;	mso-pagination:widow-orphan;	font-size:11.0pt;	font-family:"Calibri","sans-serif";	mso-ascii-font-family:calibri;	mso-ascii-theme-font:minor-latin;	mso-fareast-font-family:calibri;	mso-fareast-theme-font:minor-latin;	mso-hansi-font-family:calibri;	mso-hansi-theme-font:minor-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:minor-bidi;}p.msolistparagraphcxspfirst, li.msolistparagraphcxspfirst, div.msolistparagraphcxspfirst	{mso-style-priority:34;	mso-style-unhide:no;	mso-style-qformat:yes;	mso-style-type:export-only;	margin-top:0in;	margin-right:0in;	margin-bottom:0in;	margin-left:.5in;	margin-bottom:.0001pt;	mso-add-space:auto;	line-height:115%;	mso-pagination:widow-orphan;	font-size:11.0pt;	font-family:"Calibri","sans-serif";	mso-ascii-font-family:calibri;	mso-ascii-theme-font:minor-latin;	mso-fareast-font-family:calibri;	mso-fareast-theme-font:minor-latin;	mso-hansi-font-family:calibri;	mso-hansi-theme-font:minor-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:minor-bidi;}p.msolistparagraphcxspmiddle, li.msolistparagraphcxspmiddle, div.msolistparagraphcxspmiddle	{mso-style-priority:34;	mso-style-unhide:no;	mso-style-qformat:yes;	mso-style-type:export-only;	margin-top:0in;	margin-right:0in;	margin-bottom:0in;	margin-left:.5in;	margin-bottom:.0001pt;	mso-add-space:auto;	line-height:115%;	mso-pagination:widow-orphan;	font-size:11.0pt;	font-family:"Calibri","sans-serif";	mso-ascii-font-family:calibri;	mso-ascii-theme-font:minor-latin;	mso-fareast-font-family:calibri;	mso-fareast-theme-font:minor-latin;	mso-hansi-font-family:calibri;	mso-hansi-theme-font:minor-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:minor-bidi;}p.msolistparagraphcxsplast, li.msolistparagraphcxsplast, div.msolistparagraphcxsplast	{mso-style-priority:34;	mso-style-unhide:no;	mso-style-qformat:yes;	mso-style-type:export-only;	margin-top:0in;	margin-right:0in;	margin-bottom:10.0pt;	margin-left:.5in;	mso-add-space:auto;	line-height:115%;	mso-pagination:widow-orphan;	font-size:11.0pt;	font-family:"Calibri","sans-serif";	mso-ascii-font-family:calibri;	mso-ascii-theme-font:minor-latin;	mso-fareast-font-family:calibri;	mso-fareast-theme-font:minor-latin;	mso-hansi-font-family:calibri;	mso-hansi-theme-font:minor-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:minor-bidi;}span.heading2char	{mso-style-name:"Heading 2 Char";	mso-style-priority:9;	mso-style-unhide:no;	mso-style-locked:yes;	mso-style-link:"Heading 2";	mso-ansi-font-size:13.0pt;	mso-bidi-font-size:13.0pt;	font-family:"Cambria","serif";	mso-ascii-font-family:cambria;	mso-ascii-theme-font:major-latin;	mso-fareast-font-family:"Times New Roman";	mso-fareast-theme-font:major-fareast;	mso-hansi-font-family:cambria;	mso-hansi-theme-font:major-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:major-bidi;	color:#4f81bd;	mso-themecolor:accent1;	font-weight:bold;}span.heading1char	{mso-style-name:"Heading 1 Char";	mso-style-priority:9;	mso-style-unhide:no;	mso-style-locked:yes;	mso-style-link:"Heading 1";	mso-ansi-font-size:14.0pt;	mso-bidi-font-size:14.0pt;	font-family:"Cambria","serif";	mso-ascii-font-family:cambria;	mso-ascii-theme-font:major-latin;	mso-fareast-font-family:"Times New Roman";	mso-fareast-theme-font:major-fareast;	mso-hansi-font-family:cambria;	mso-hansi-theme-font:major-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:major-bidi;	color:#365f91;	mso-themecolor:accent1;	mso-themeshade:191;	font-weight:bold;}span.heading3char	{mso-style-name:"Heading 3 Char";	mso-style-priority:9;	mso-style-unhide:no;	mso-style-locked:yes;	mso-style-link:"Heading 3";	font-family:"Cambria","serif";	mso-ascii-font-family:cambria;	mso-ascii-theme-font:major-latin;	mso-fareast-font-family:"Times New Roman";	mso-fareast-theme-font:major-fareast;	mso-hansi-font-family:cambria;	mso-hansi-theme-font:major-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:major-bidi;	color:#4f81bd;	mso-themecolor:accent1;	font-weight:bold;}span.htmlpreformattedchar	{mso-style-name:"HTML Preformatted Char";	mso-style-priority:99;	mso-style-unhide:no;	mso-style-locked:yes;	mso-style-link:"HTML Preformatted";	mso-ansi-font-size:10.0pt;	mso-bidi-font-size:10.0pt;	font-family:"Courier New";	mso-ascii-font-family:"Courier New";	mso-fareast-font-family:"Times New Roman";	mso-hansi-font-family:"Courier New";	mso-bidi-font-family:"Courier New";}span.heading4char	{mso-style-name:"Heading 4 Char";	mso-style-priority:9;	mso-style-unhide:no;	mso-style-locked:yes;	mso-style-link:"Heading 4";	font-family:"Cambria","serif";	mso-ascii-font-family:cambria;	mso-ascii-theme-font:major-latin;	mso-fareast-font-family:"Times New Roman";	mso-fareast-theme-font:major-fareast;	mso-hansi-font-family:cambria;	mso-hansi-theme-font:major-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:major-bidi;	color:#4f81bd;	mso-themecolor:accent1;	font-weight:bold;	font-style:italic;}span.spelle	{mso-style-name:"";	mso-spl-e:yes;}span.grame	{mso-style-name:"";	mso-gram-e:yes;}.msochpdefault	{mso-style-type:export-only;	mso-default-props:yes;	mso-ascii-font-family:calibri;	mso-ascii-theme-font:minor-latin;	mso-fareast-font-family:calibri;	mso-fareast-theme-font:minor-latin;	mso-hansi-font-family:calibri;	mso-hansi-theme-font:minor-latin;	mso-bidi-font-family:"Times New Roman";	mso-bidi-theme-font:minor-bidi;}.msopapdefault	{mso-style-type:export-only;	margin-bottom:10.0pt;	line-height:115%;}@page section1	{size:8.5in 11.0in;	margin:1.0in 1.0in 1.0in 1.0in;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.section1	{page:section1;} /* List Definitions */ @list l0	{mso-list-id:251742053;	mso-list-type:hybrid;	mso-list-template-ids:539099456 1519052768 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}@list l0:level1	{mso-level-tab-stop:none;	mso-level-number-position:left;	margin-left:1.25in;	text-indent:-.25in;}@list l1	{mso-list-id:475882044;	mso-list-type:hybrid;	mso-list-template-ids:-1038576714 1519052768 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}@list l1:level1	{mso-level-tab-stop:none;	mso-level-number-position:left;	margin-left:1.25in;	text-indent:-.25in;}@list l2	{mso-list-id:478621536;	mso-list-type:hybrid;	mso-list-template-ids:539099456 1519052768 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}@list l2:level1	{mso-level-tab-stop:none;	mso-level-number-position:left;	margin-left:1.25in;	text-indent:-.25in;}@list l3	{mso-list-id:1407609238;	mso-list-type:hybrid;	mso-list-template-ids:539099456 1519052768 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}@list l3:level1	{mso-level-tab-stop:none;	mso-level-number-position:left;	margin-left:1.25in;	text-indent:-.25in;}ol	{margin-bottom:0in;}ul	{margin-bottom:0in;}--&gt;&lt;/style&gt;&lt;h1 class="Section1" style="text-align: center" align="center"&gt;&amp;#160;&lt;/h1&gt;&lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;In this article we will discuss –&lt;/p&gt;&lt;p class="MsoListParagraphCxSpFirst" style="margin-left: 1.25in; text-indent: -0.25in; mso-add-space: auto; mso-list: l1 level1 lfo4"&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: ignore"&gt;1.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Why we need generics?&lt;/p&gt;&lt;p class="MsoListParagraphCxSpMiddle" style="margin-left: 1.25in; text-indent: -0.25in; mso-add-space: auto; mso-list: l1 level1 lfo4"&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: ignore"&gt;2.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;How to implement Generics?&lt;/p&gt;&lt;p class="MsoListParagraphCxSpMiddle" style="margin-left: 1.25in; text-indent: -0.25in; mso-add-space: auto; mso-list: l1 level1 lfo4"&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: ignore"&gt;3.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;How compiler helps us?&lt;/p&gt;&lt;p class="MsoListParagraphCxSpMiddle" style="margin-left: 1.25in; text-indent: -0.25in; mso-add-space: auto; mso-list: l1 level1 lfo4"&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: ignore"&gt;4.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Other features&lt;/p&gt;&lt;p class="MsoListParagraphCxSpLast" style="margin-left: 1.25in; mso-add-space: auto"&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;h3 class="Section1"&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;Why we need generics?&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;      &lt;/span&gt;&lt;/h3&gt;&lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;To get the relevance of generics we have to walk through C# 1.1 world.&lt;/p&gt;&lt;h4 class="Section1"&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;Performance issue in 1.1       &lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;Consider the case where we need to have a class that deals with any type. The class will be like –&lt;/p&gt;&lt;div class="Section1"&gt;  &lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; GenericClass&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  2:     {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  3:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; a { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&lt;/span&gt;; }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  4:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; Invoke()&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  5:         {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  6:             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; a;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  7:         }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  8:     }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  9: &lt;/pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="Section1"&gt;&amp;#160;&lt;/div&gt;&lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;If I want to deal with integer type on this class –&lt;/p&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: GenericClass myGenericClass = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; GenericClass();&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  2: myGenericClass.a = 1;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  3: &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; b = (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)myGenericClass.Invoke();&lt;/pre&gt;&lt;/pre&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;In this case the integer value 1 is assigned to object property. Integer is a value type and hence to hold this integer value, a new object is created in memory and the integer value is taken into it. This is called &lt;b style="mso-bidi-font-weight: normal"&gt;boxing&lt;/b&gt;. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;When you are retrieving the integer value back to ‘b’, the integer value stored in the object is retrieved. This is &lt;b style="mso-bidi-font-weight: normal"&gt;unboxing. &lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;So obviously boxing and unboxing takes more memory and more time, When we deal with large collections, this memory and time consumption is signinificant that it reduces the overall performance. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Consider the case of dealing with reference types - &lt;/span&gt;&lt;/p&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: GenericClass myGenericClass = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; GenericClass();&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  2: myGenericClass.a = &amp;quot;&lt;span style="color: #8b0000"&gt;1&lt;/span&gt;&amp;quot; ;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  3: &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; b = (&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;)myGenericClass.Invoke();&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  4: &lt;/pre&gt;&lt;/pre&gt;&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;A string object is assigned to the property ‘a’ and the same is retrieved from ‘Invoke()’ to ‘b’. This actually involves &lt;b style="mso-bidi-font-weight: normal"&gt;Casting&lt;/b&gt; from one type to another (String to Object and Object to String). &lt;/span&gt;This also affects performance.&lt;/p&gt;&lt;h4 class="Section1"&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;Solution in 1.1       &lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;We can resolve this performance issue by making our class strongly typed. &lt;span class="SpellE"&gt;Ie&lt;/span&gt;, for using integer types, define class as –&lt;/p&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; IntClass&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  2:     {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  3:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; a { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&lt;/span&gt;; }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  4:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Invoke()&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  5:         {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  6:             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; a;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  7:         }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  8:     }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  9: &lt;/pre&gt;&lt;/pre&gt;&lt;p&gt; For string-&lt;/p&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; StringClass&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  2:     {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  3:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; a { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&lt;/span&gt;; }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  4:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Invoke()&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  5:         {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  6:             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; a;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  7:         }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  8:     }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  9: &lt;/pre&gt;&lt;/pre&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;When we use such strongly typed classes, boxing, &lt;span class="SpellE"&gt;unboxing&lt;/span&gt; and casting will be avoided and hence the performance will be enhanced.&lt;/p&gt;&lt;h4 class="Section1"&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;Drawback for 1.1 solution       &lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;We can go for separate class declarations for each type (string, &lt;span class="SpellE"&gt;int&lt;/span&gt;, etc). But if you are using this class declaration for ‘n’ types, you have to declare ‘n’ different classes (differ only in type used inside the method).&lt;/p&gt;&lt;h4 class="Section1"&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;Solution in 2.0       &lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;From above examples you can see that different classes we declare is following same template and the type is replaced with the type we need.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;In 2.0 generics concept is introduced to avoid the headache of declaring different classes for types we need.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;In generics the things that we discussed above is split among developer and compiler -&lt;span style="mso-tab-count: 1"&gt; &lt;/span&gt;&lt;/p&gt;&lt;h3 class="Section1"&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;How to implement Generics?       &lt;/span&gt;&lt;/h3&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;For above mentioned example, generic class is -&lt;/p&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; GenericClass&amp;lt;T&amp;gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  2:     {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  3:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; T a { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&lt;/span&gt;; }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  4:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; T Invoke()&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  5:         {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  6:             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; a;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  7:         }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  8:     }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  9: &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt; 10: &lt;/pre&gt;&lt;/pre&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;It is nothing but you declared a class that can be used as template for class declaration using any type. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;When you define a variable for generic class – &lt;/span&gt;&lt;/p&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: GenericClass&amp;lt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&amp;gt; intClass = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; GenericClass&amp;lt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&amp;gt;();&lt;/pre&gt;&lt;/pre&gt;&lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;The type you need is passed instead of ‘T’ in declaration. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;So developer simply declares the template and request for a class declared for the type he needed. &lt;/span&gt;&lt;/p&gt;&lt;h3 class="Section1"&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;How compiler helps us?       &lt;/span&gt;&lt;/h3&gt;&lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;When developer defines variable as –&lt;/p&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: GenericClass&amp;lt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&amp;gt; intClass = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; GenericClass&amp;lt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&amp;gt;();&lt;/pre&gt;&lt;/pre&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;Compiler access the template defined and replaces all ‘T’s with type requested by developer and eventually declares a new class as –&lt;/p&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; IntGenericClass&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  2:     {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  3:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; a { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&lt;/span&gt;; }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  4:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Invoke()&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  5:         {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  6:             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; a;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  7:         }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  8:     }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  9: &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt; 10: &lt;/pre&gt;&lt;/pre&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;Then the variable ‘&lt;span class="SpellE"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;intClass&lt;/span&gt;&lt;/span&gt;’ points to the instance created for new class declared ‘&lt;span class="SpellE"&gt;&lt;span style="color: black; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;IntGenericClass&lt;/span&gt;&lt;/span&gt;’.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;By this way the strongly typed classes are defined by compiler for any type you need.&lt;/p&gt;&lt;h3 class="Section1"&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;Other features       &lt;/span&gt;&lt;/h3&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;You can restrict the types that can be used to declare classes from your generic template.&lt;/p&gt;&lt;h4 class="Section1"&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;Type constraint       &lt;/span&gt;&lt;/h4&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; GenericClass&amp;lt;T&amp;gt; where T : IList,ICollection &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  2:     {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  3:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; T a { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&lt;/span&gt;; }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  4:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; T Invoke()&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  5:         {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  6:             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; a;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  7:         }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  8:     }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  9: &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt; 10: &lt;/pre&gt;&lt;/pre&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;This is called type constraint where you are saying ‘T’ should implement interface ‘&lt;span class="SpellE"&gt;IList&lt;/span&gt;’ and ‘&lt;span class="SpellE"&gt;ICollection&lt;/span&gt;’.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;So in this case you can define –&lt;/p&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: GenericClass&amp;lt;ArrayList&amp;gt; arrayClass = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; GenericClass&amp;lt;ArrayList&amp;gt;();&lt;/pre&gt;&lt;/pre&gt;&lt;p class="MsoNormal"&gt;&amp;#160;&lt;/p&gt;&lt;blockquote&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Because &lt;span style="color: #2b91af"&gt;ArrayList &lt;/span&gt;is implementing &lt;span style="color: #2b91af"&gt;IList&lt;/span&gt; and &lt;span style="color: #2b91af"&gt;ICollection&lt;/span&gt;.&lt;span style="color: #2b91af"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;        &lt;/blockquote&gt;&lt;blockquote&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;But you cannot do following definition – &lt;/span&gt;&lt;/p&gt;      &lt;/blockquote&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: GenericClass&amp;lt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&amp;gt; intClass = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; GenericClass&amp;lt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&amp;gt;();&lt;/pre&gt;&lt;/pre&gt;&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="color: blue; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; GenericClass&amp;lt;T&amp;gt; where T : &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  2:     {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  3:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; T a { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&lt;/span&gt;; }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  4:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; T Invoke()&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  5:         {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  6:             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; a;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  7:         }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  8:     }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  9: &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt; 10: &lt;/pre&gt;&lt;/pre&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;This means you can use only refernce types as ‘T’. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-left: 0.5in"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Right- &lt;/span&gt;&lt;/p&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: GenericClass&amp;lt;ArrayList&amp;gt; arrayClass = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; GenericClass&amp;lt;ArrayList&amp;gt;();&lt;/pre&gt;&lt;/pre&gt;&lt;p class="MsoNormal" style="margin-left: 0.5in"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;Wrong – &lt;/span&gt;&lt;/p&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: GenericClass&amp;lt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&amp;gt; intClass = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; GenericClass&amp;lt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&amp;gt;();&lt;/pre&gt;&lt;/pre&gt;&lt;h4 class="Section1"&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-no-proof: yes; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;Constructor Constraint&lt;/span&gt;&lt;/h4&gt;&lt;h4 class="Section1"&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-no-proof: yes; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;      &lt;/span&gt;&lt;/h4&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; GenericClass&amp;lt;T&amp;gt; where T : &lt;span style="color: #0000ff"&gt;new&lt;/span&gt;()&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  2:     {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  3:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; T a { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&lt;/span&gt;; }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  4:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; T Invoke()&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  5:         {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  6:             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; a;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  7:         }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  8:     }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  9: &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt; 10: &lt;/pre&gt;&lt;/pre&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&lt;/span&gt;This says that ‘T’ should have the default constructor &lt;/span&gt;&lt;/p&gt;      &lt;/blockquote&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;Right – &lt;/span&gt;&lt;/p&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1:                                 GenericClass&amp;lt;ArrayList&amp;gt; arrayClass = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; GenericClass&amp;lt;ArrayList&amp;gt;();&lt;/pre&gt;&lt;/pre&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;Wrong – &lt;/span&gt;&lt;/p&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: GenericClass&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;&amp;gt; stringClass = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; GenericClass&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;&amp;gt;();&lt;/pre&gt;&lt;/pre&gt;&lt;p class="MsoNormal" style="text-indent: 0.5in"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;You can make use of Type constraint and constructor constraint at the same time - &lt;/span&gt;&lt;/p&gt;&lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  1: &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; GenericClass&amp;lt;T&amp;gt; where T :IList, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt;()&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  2:     {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  3:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; T a { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&lt;/span&gt;; }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  4:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; T Invoke()&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  5:         {&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  6:             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; a;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  7:         }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;  8: }&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;  9: &lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt; 10: &lt;/pre&gt;&lt;/pre&gt;&lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7056431372202946395-3874047121582518259?l=logicminer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://logicminer.blogspot.com/feeds/3874047121582518259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logicminer.blogspot.com/2010/06/generics-overview.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7056431372202946395/posts/default/3874047121582518259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7056431372202946395/posts/default/3874047121582518259'/><link rel='alternate' type='text/html' href='http://logicminer.blogspot.com/2010/06/generics-overview.html' title='Generics Overview'/><author><name>Logic Miner</name><uri>http://www.blogger.com/profile/14179914684731051968</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_WXl-XZtptdc/S79pnIImIsI/AAAAAAAAAAM/4itCcD4Nluw/S220/Image013.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7056431372202946395.post-1588052890032397541</id><published>2010-06-07T23:04:00.001-07:00</published><updated>2010-06-07T23:04:10.460-07:00</updated><title type='text'>Calling Base Constructor from Child Class Constructor</title><content type='html'>&lt;p class="MsoNormal"&gt;Whenever we are writing logic for constructor of a class, the first statement in that code block should call a constructor of base class. If not we will get following error –&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;span style="color: red"&gt;    First statement of this 'Sub New' must be a call to 'MyBase.New' or 'MyClass.New' because base class 'base class name' of 'class name' does not have an accessible 'Sub New' that can be called with no arguments.&lt;o:p&gt;&lt;/o:p&gt;  &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Example:&lt;/p&gt;&lt;div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; text-align: left; max-height: 200px"&gt;  &lt;div id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt;&amp;#160;    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt;()    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;&amp;#160;    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; l_instanceContext &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; System.ServiceModel.InstanceContext(&lt;span style="color: #0000ff"&gt;New&lt;/span&gt; DuplexSvcClientCallback)    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; l_PollingDuplexHttpBinding &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; PollingDuplexHttpBinding    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; l_EndpointAddress &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; EndpointAddress(&lt;span style="color: #006080"&gt;&amp;quot;http://localhost/MyDuplexService/DuplexSvc.svc&amp;quot;&lt;/span&gt;)    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;MyBase&lt;/span&gt;.&lt;span style="color: #0000ff"&gt;New&lt;/span&gt;(l_instanceContext, l_PollingDuplexHttpBinding, l_EndpointAddress)    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum8" style="color: #606060"&gt;   8:&lt;/span&gt;&amp;#160;    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum9" style="color: #606060"&gt;   9:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt;    &lt;/pre&gt;      &lt;/div&gt;&lt;/div&gt;&lt;p class="MsoNormal"&gt;This is wrong and will give above error message.&lt;/p&gt;&lt;p class="MsoNormal"&gt;The logic can be corrected by calling base constructor as first statement –&lt;/p&gt;&lt;div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; text-align: left; max-height: 200px"&gt;  &lt;div id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt;&amp;#160;    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt;()    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;&amp;#160;    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;MyBase&lt;/span&gt;.&lt;span style="color: #0000ff"&gt;New&lt;/span&gt;(    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt;          &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; System.ServiceModel.InstanceContext(&lt;span style="color: #0000ff"&gt;New&lt;/span&gt; DuplexSvcClientCallback),    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt;          &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; PollingDuplexHttpBinding,    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt;          &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; EndpointAddress(&lt;span style="color: #006080"&gt;&amp;quot;http://localhost/MyDuplexService/DuplexSvc.svc&amp;quot;&lt;/span&gt;)    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum8" style="color: #606060"&gt;   8:&lt;/span&gt;          )    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum9" style="color: #606060"&gt;   9:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt;    &lt;/pre&gt;      &lt;/div&gt;&lt;/div&gt;&lt;p class="MsoNormal"&gt;Note that the base constructor call is the first statement and you have all the logic implemented in it.&lt;/p&gt;&lt;p class="MsoNormal"&gt;You can even write your logic in a shared/static method and call from first statement as follows:&lt;/p&gt;&lt;div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; text-align: left; max-height: 200px"&gt;  &lt;div id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt;&amp;#160;    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt;()    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;&amp;#160;    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;MyBase&lt;/span&gt;.&lt;span style="color: #0000ff"&gt;New&lt;/span&gt;(GetInstanceContext(), &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; PollingDuplexHttpBinding,    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; EndpointAddress(&lt;span style="color: #006080"&gt;&amp;quot;http://localhost/MyDuplexService/DuplexSvc.svc&amp;quot;&lt;/span&gt;))    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt;&amp;#160;    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt;    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum8" style="color: #606060"&gt;   8:&lt;/span&gt;&amp;#160;    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum9" style="color: #606060"&gt;   9:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;Private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Shared&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Function&lt;/span&gt; GetInstanceContext() &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; System.ServiceModel.InstanceContext    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum10" style="color: #606060"&gt;  10:&lt;/span&gt;&amp;#160;    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum11" style="color: #606060"&gt;  11:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;Return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; System.ServiceModel.InstanceContext(&lt;span style="color: #0000ff"&gt;New&lt;/span&gt; DuplexSvcClientCallback)    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum12" style="color: #606060"&gt;  12:&lt;/span&gt;&amp;#160;    &lt;/pre&gt;        &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;      &lt;span id="lnum13" style="color: #606060"&gt;  13:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Function&lt;/span&gt;    &lt;/pre&gt;      &lt;/div&gt;&lt;/div&gt;&lt;p class="MsoNormal"&gt;  &lt;span style="font-size: 10pt; line-height: 115%"&gt;    &lt;span style="color: blue"&gt;&lt;/span&gt;  &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Note:&lt;/p&gt;&lt;p class="MsoNormal"&gt;While writing constructor, if no base class constructor is explicitly called, then the default constructor of base class (constructor without arguments) will be called.&lt;/p&gt;&lt;p class="MsoNormal"&gt;If base class lacks default constructor, then writing child class without explicitly calling base class constructor will cause the error mentioned&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7056431372202946395-1588052890032397541?l=logicminer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://logicminer.blogspot.com/feeds/1588052890032397541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logicminer.blogspot.com/2010/06/calling-base-constructor-from-child.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7056431372202946395/posts/default/1588052890032397541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7056431372202946395/posts/default/1588052890032397541'/><link rel='alternate' type='text/html' href='http://logicminer.blogspot.com/2010/06/calling-base-constructor-from-child.html' title='Calling Base Constructor from Child Class Constructor'/><author><name>Logic Miner</name><uri>http://www.blogger.com/profile/14179914684731051968</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_WXl-XZtptdc/S79pnIImIsI/AAAAAAAAAAM/4itCcD4Nluw/S220/Image013.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7056431372202946395.post-2495024199474337347</id><published>2010-06-07T22:55:00.001-07:00</published><updated>2010-06-07T22:55:04.883-07:00</updated><title type='text'>My First Step</title><content type='html'>This is my first step to blog world.  &lt;div&gt;A small tip for javascript-&lt;/div&gt;  &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre"&gt; &lt;/span&gt;Javascript is case sensitive and it usually follows camel case&lt;/div&gt;  &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre"&gt; &lt;/span&gt;Eg: getElementById, getElementsByName, execCommand, documentElement, etc&lt;/div&gt;  &lt;div&gt;   &lt;br /&gt;&lt;/div&gt;  &lt;div&gt;Camel case is nothing but the first word will start with small case letter and subsequent words with upper case.&lt;/div&gt;  &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre"&gt; &lt;/span&gt;ie, &lt;b&gt;g&lt;/b&gt;et&lt;b&gt;E&lt;/b&gt;lement&lt;b&gt;B&lt;/b&gt;y&lt;b&gt;I&lt;/b&gt;d&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7056431372202946395-2495024199474337347?l=logicminer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://logicminer.blogspot.com/feeds/2495024199474337347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://logicminer.blogspot.com/2010/06/my-first-step.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7056431372202946395/posts/default/2495024199474337347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7056431372202946395/posts/default/2495024199474337347'/><link rel='alternate' type='text/html' href='http://logicminer.blogspot.com/2010/06/my-first-step.html' title='My First Step'/><author><name>Logic Miner</name><uri>http://www.blogger.com/profile/14179914684731051968</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_WXl-XZtptdc/S79pnIImIsI/AAAAAAAAAAM/4itCcD4Nluw/S220/Image013.jpg'/></author><thr:total>0</thr:total></entry></feed>
