<?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:blogger='http://schemas.google.com/blogger/2008' 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-7063370021399208544</id><updated>2024-10-25T12:51:54.501+05:30</updated><category term="Think_Hatkey"/><category term=".NET"/><category term="Download"/><category term="Debashish"/><category term="Debashish Das"/><category term="Dev"/><category term="Devashish"/><category term="Devashish Das"/><category term="Others"/><category term="Private Method"/><category term="Sealed Method"/><category term="Super Trading Shorts"/><title type='text'>Dev Blog No. 1</title><subtitle type='html'>This blog contain information collected by Dev. Like Oops, C#, SQL, Jokes, Videos etc.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>63</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-4369275707418695595</id><published>2021-06-07T21:30:00.002+05:30</published><updated>2021-06-07T21:31:41.106+05:30</updated><title type='text'>Abstract Class Vs Interface</title><content type='html'>&lt;p&gt;&lt;b&gt;&amp;nbsp;Interface&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Completely &quot;abstract class&quot;, which can only contain abstract methods and properties (with empty bodies).&lt;/li&gt;&lt;li&gt;By default, members of are abstract and public.&lt;/li&gt;&lt;li&gt;Can contain properties and methods, but not fields.&lt;/li&gt;&lt;li&gt;The body must be provided by the &quot;derived&quot; class without using override keyword.&lt;/li&gt;&lt;li&gt;Virtual method is not allowed in interface.&lt;/li&gt;&lt;li&gt;Cannot contain a constructor.&lt;/li&gt;&lt;li&gt;Multiple inheritance can achieved.&lt;/li&gt;&lt;li&gt;It can&#39;t be instantiate.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Abstract Class&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;It is Restricted class, that cannot be instantiate.&lt;/li&gt;&lt;li&gt;To access it, it must be inherited from another class.&lt;/li&gt;&lt;li&gt;Typically used to define a base class in the class hierarchy.&lt;/li&gt;&lt;li&gt;An abstract class can have both abstract and regular methods.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Wrong&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;color: red;&quot;&gt;This class must contain at least one abstract method.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: red;&quot;&gt;Abstract classes are either partially implemented or not implemented at all.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;public interface IInterface &lt;span style=&quot;color: #6aa84f;&quot;&gt;// sealed, private, protected, protected internal are not possible, public is&lt;/span&gt; optional (by default public)&lt;br /&gt;{&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;/blockquote&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; void demo();&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; void demo1();&amp;nbsp;&lt;br /&gt;}&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;/blockquote&gt;public class InterfaceDemoTest : IInterface&lt;br /&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;/blockquote&gt;{&lt;br /&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;/blockquote&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void demo()&lt;br /&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;/blockquote&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;/blockquote&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Demo Method Called&quot;);&lt;br /&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;/blockquote&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;/blockquote&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void demo1()&lt;br /&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;/blockquote&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;/blockquote&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Demo1 Method Called&quot;);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&lt;div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;public abstract class AbstractClass&lt;span style=&quot;color: #6aa84f;&quot;&gt; // sealed, private, protected, protected internal are not possible&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;{&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int x, y;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public AbstractClass()&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Abstract Constructor Called&quot;);&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Abstract method&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Without abstract method is also possible&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public abstract void demo();&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Concrete method&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public virtual void demo1()&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Non-Abstract Parent Method Called&quot;);&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; public class AbstractDemoTest: AbstractClass&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public override void demo()&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Abstract Method Called&quot;);&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AbstractClass abs = new AbstractDemoTest(); // new AbstractClass() is not possible&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div&gt;class Program&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AbstractDemoTest abstractDemoTest = new AbstractDemoTest();&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; abstractDemoTest.demo();&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; abstractDemoTest.demo1();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InterfaceDemoTest interfaceDemoTest = new InterfaceDemoTest();&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; interfaceDemoTest.demo();&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; interfaceDemoTest.demo1();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IInterface iinterface = new InterfaceDemoTest();&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iinterface.demo();&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iinterface.demo1();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.ReadLine();&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;}&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: none; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;&quot;&gt;
 &lt;tbody&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; style=&quot;background: rgb(217, 217, 217); border: 1pt solid black; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; padding: 0cm 5.4pt; width: 462.1pt;&quot; valign=&quot;top&quot; width=&quot;616&quot;&gt;
  &lt;p align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #444444;&quot;&gt;Difference between Abstract class and
  Interface&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid black; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Abstract&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid black; border-left: none; border-right: 1pt solid black; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Interface&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid black; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Can have abstract and regular(concrete) methods both&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid black; border-left: none; border-right: 1pt solid black; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Can have only abstract methods without abstract keyword&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid black; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Can have Constructor&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid black; border-left: none; border-right: 1pt solid black; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Can’t have Constructor&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid black; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Can create object as reference to child class&lt;/p&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;AbstractClass abs = new AbstractDemoTest();&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid black; border-left: none; border-right: 1pt solid black; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Can create object as reference to child class&lt;/p&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;IInterface iinterface = new InterfaceDemoTest();&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid black; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;By default private class&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid black; border-left: none; border-right: 1pt solid black; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;By default public interface&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid black; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Access modifiers required for methods&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid black; border-left: none; border-right: 1pt solid black; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Access modifiers not required for methods&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid black; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Multiple inheritances can’t achieve.&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid black; border-left: none; border-right: 1pt solid black; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Multiple inheritances can achieve.&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid black; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Can contain fields&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid black; border-left: none; border-right: 1pt solid black; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Can’t contain fields&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid black; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Only Abstract methods must be implement in derived class&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid black; border-left: none; border-right: 1pt solid black; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;All methods must be implement in derived class&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid black; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Used for inheritance&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid black; border-left: none; border-right: 1pt solid black; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Used for inheritance&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;br /&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: none; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;&quot;&gt;
 &lt;tbody&gt;&lt;tr&gt;
  &lt;td style=&quot;background: rgb(217, 217, 217); border: 1pt solid black; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; padding: 0cm 5.4pt; width: 462.1pt;&quot; valign=&quot;top&quot; width=&quot;616&quot;&gt;
  &lt;p align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #444444;&quot;&gt;Similarities between Abstract class and
  Interface&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid black; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 462.1pt;&quot; valign=&quot;top&quot; width=&quot;616&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Can’t Create Instance&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid black; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 462.1pt;&quot; valign=&quot;top&quot; width=&quot;616&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Abstract methods must me implement in derived class&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid black; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 462.1pt;&quot; valign=&quot;top&quot; width=&quot;616&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Used for inheritance&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid black; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt; width: 462.1pt;&quot; valign=&quot;top&quot; width=&quot;616&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot;&gt;Used as Parent in inheritance&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;&lt;p&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/4369275707418695595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2021/06/abstract-class-vs-interface.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/4369275707418695595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/4369275707418695595'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2021/06/abstract-class-vs-interface.html' title='Abstract Class Vs Interface'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-999191580442518666</id><published>2021-05-27T14:34:00.001+05:30</published><updated>2021-05-27T14:34:14.085+05:30</updated><title type='text'>Test Cafe</title><content type='html'>&lt;p&gt;&lt;b&gt;&lt;u&gt;&amp;nbsp;What is Test Cafe&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Allows you to write tests using TypeScript or JavaScript&lt;/li&gt;&lt;li&gt;End-to-end free and open source automation tool which is used to test web applications&lt;/li&gt;&lt;li&gt;Works on all popular environments such as Windows, MacOS, and Linux&lt;/li&gt;&lt;li&gt;Easy to install feature in a single command&lt;/li&gt;&lt;li&gt;Does not depend on Selenium or other testing software&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;How to Install&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;npm install -g testcafe&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;Sample Program&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;import { Selector } from &#39;testcafe&#39;;&lt;/p&gt;&lt;p&gt;fixture `Getting Started`// declare the fixture&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; .page `https://devexpress.github.io/testcafe/example`;&amp;nbsp; // specify the start page&lt;/p&gt;&lt;p&gt;//then create a test and place your code there&lt;/p&gt;&lt;p&gt;test(&#39;My first test&#39;, async t =&amp;gt; {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; await t&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .wait(2000)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .typeText(&#39;#developer-name&#39;, &#39;John Smith&#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .click(&#39;#submit-button&#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Use the assertion to check if the actual header text is equal to the expected one&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .expect(Selector(&#39;#article-header&#39;).innerText).eql(&#39;Thank you, John Smith!&#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .wait(2000);&lt;/p&gt;&lt;p&gt;});&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;How to Run&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;testcafe chrome test1.js&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Fiture:&lt;/b&gt; TestCafe tests are organized into categories called fixuture. Fixture can be compared with Module where test cases related to similar functionalities are maintained.&lt;/p&gt;&lt;p&gt;Declare Fixture&lt;/p&gt;&lt;p&gt;fixture ( fixtureName )&lt;/p&gt;&lt;p&gt;fixture `fixtureName`&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Test: &lt;/b&gt;test case/functionality to be verified&lt;/p&gt;&lt;p&gt;test ( &#39;testName&#39;, fn(t))&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Test Controller:&lt;/b&gt; object t exposes the test API&#39;s methods. Thus it is passed to each function.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Page can be written in two ways&lt;/p&gt;&lt;p&gt;1. fixture `fixtureName`&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; .page `PageUrl`;&lt;/p&gt;&lt;p&gt;2. test&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; .page `PageUrl`&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;(&#39;testName&#39;, fn(t));&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Actions&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Browser&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Returns information about the current user agent: the operating system, platform type, browser, engine, etc.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.browser&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if (t.browser.name !== &#39;Chrome&#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; await t.expect(Selector(&#39;div&#39;).withText(&#39;Browser not supported&#39;).visible).ok();&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;ClearUpload&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Removes all file paths from the specified file upload input.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.clearUpload(selector)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.setFilesToUpload(&#39;#upload-input&#39;, [&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;./uploads/1.jpg&#39;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;./uploads/2.jpg&#39;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;./uploads/3.jpg&#39;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ])&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .clearUpload(&#39;#upload-input&#39;)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;OpenWindow&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Opens a new browser window.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.openWindow( url )&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.openWindow(&#39;http://devexpress.github.io/testcafe&#39;)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .openWindow(&#39;./documentation&#39;);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;CloseWindow&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Closes a browser window. Each call of the t.closeWindow method closes the active window:&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.closeWindow([windowDescriptor])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.1&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.openWindow(&#39;https://devexpress.github.io/testcafe&#39;);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .openWindow(&#39;https://devexpress.com&#39;);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .closeWindow()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .closeWindow();&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;b&gt;eg.2&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;const testcafe =&amp;nbsp; await t.openWindow(&#39;https://devexpress.github.io/testcafe&#39;);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;await t.openWindow(&#39;https://devexpress.com&#39;);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;const devexpress = await t.getCurrentWindow();&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;await t.closeWindow(devexpress)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .closeWindow(testcafe);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Debug&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Pauses the test and allows you to use the browser’s developer tools.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.debug()&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.debug()&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;DoubleClick&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Double-clicks an element on a page.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.doubleClick(selector [, options])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const dialog = Selector(&#39;#dialog&#39;);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.doubleClick(&#39;#thumbnail&#39;)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .expect(dialog.visible).ok();&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Drag&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Drags an element to a specified offset.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.drag(selector, dragOffsetX, dragOffsetY [, options])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.drag(&#39;.ui-slider-handle&#39;, 360, 0, { offsetX: 10, offsetY: 10 })&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.expect(slider.value).eql(7);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;DragToElement&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Drags an element onto another web page element.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.dragToElement(selector, destinationSelector [, options])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const designSurfaceItems = Selector(&#39;.design-surface&#39;).find(&#39;.items&#39;);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.dragToElement(&#39;.toolbox-item.text-input&#39;, &#39;.design-surface&#39;)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.expect(designSurfaceItems.count).gt(0);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Eval&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Creates a client function and executes it immediately (without saving).&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Always place eval in a separate call.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.eval(fn [, options])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.1&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const docURI = await t.eval(() =&amp;gt; document.documentURI);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.2&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;await t.eval(() =&amp;gt; location.reload(true));&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Expect&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;This method accepts the actual value.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;await t.expect(doSomethingAsync()).ok(&#39;check that a promise is returned&#39;, { allowUnawaitedPromise: true });&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.1&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.expect(developerNameInput.value).eql(&#39;&#39;, &#39;input is empty&#39;)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.2&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.expect(developerNameInput.value).notEql(&#39;&#39;, &#39;input is empty&#39;)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.3&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.expect(developerNameInput.value).contains(&#39;Peter&#39;, &#39;input contains text &quot;Peter&quot;&#39;);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.4&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.expect(Selector(&#39;#element&#39;).exists).ok();&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.5&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.expect(Selector(&#39;#element&#39;).exists).notOk();&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.6&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.expect(Selector(&#39;#element&#39;).getAttribute(&#39;attr&#39;)).typeOf(&#39;string&#39;);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.7&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.expect(Selector(&#39;#element&#39;).getAttribute(&#39;attr&#39;)).typeOf(&#39;string&#39;);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.8&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.expect(Selector(&#39;#element&#39;).clientWidth).gt(300);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.9&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.expect(Selector(&#39;#element&#39;).clientWidth).gte(300);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.10&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.expect(Selector(&#39;#element&#39;).clientWidth).lt(300);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.11&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.expect(Selector(&#39;#element&#39;).clientWidth).lte(300);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.12&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.expect(Selector(&#39;#element&#39;).scrollTop).within(300, 400);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.13&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.expect(Selector(&#39;#element&#39;).scrollTop).within(300, 400);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.14&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.expect(developerNameInput.value).match(/\.com/);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.15&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.expect(developerNameInput.value).notMatch(/\.com/);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;getBrowserConsoleMessages&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Returns messages posted to the browser console. Cannot be chained with other methods of the test controller.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.getBrowserConsoleMessages()&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;// check-prop-types.js&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;import { t } from &#39;testcafe&#39;;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;export default async function () {&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; const { error } = await t.getBrowserConsoleMessages();&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; await t.expect(error[0]).notOk();&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;// test.js&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;import { Selector } from &#39;testcafe&#39;;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;import checkPropTypes from &#39;./check-prop-types&#39;;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;fixture `react example`&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; .page `http://localhost:8080/`&amp;nbsp; // https://github.com/mzabriskie/react-example&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; .afterEach(() =&amp;gt; checkPropTypes());&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;test(&#39;test&#39;, async t =&amp;gt; {&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; await t&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .typeText(Selector(&#39;.form-control&#39;), &#39;devexpress&#39;)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .click(Selector(&#39;button&#39;).withText(&#39;Go&#39;))&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .click(Selector(&#39;h4&#39;).withText(&#39;Organizations&#39;));&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;});&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Note:&lt;/b&gt; This method can be used with below fields&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;error (Array of String) Error messages printed in the console.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;warn (Array of String) Warning messages printed in the console.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;log (Array of String) Log messages printed in the console.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;info (Array of String) Information messages printed in the console.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;getCurrentWindow&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Retrieves a window descriptor that corresponds to the active window.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.getCurrentWindow()&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;await t.openWindow(&#39;https://devexpress.com&#39;);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; const devexpress = await t.getCurrentWindow();&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; await t.closeWindow(devexpress);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;hover&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Hovers the mouse pointer over a web page element.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.hover(selector [, options])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const comboBox = Selector(&#39;.combo-box&#39;);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.hover(comboBox)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;maximizeWindow&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Maximizes the browser window.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;t.maximizeWindow()&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.maximizeWindow()&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;navigateTo&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Navigates to the specified URL.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.navigateTo(url)&lt;/p&gt;&lt;p&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.navigateTo(&#39;http://devexpress.github.io/testcafe&#39;)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.navigateTo(&#39;file:///user/my-website/index.html&#39;)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .navigateTo(&#39;../my-project/index.html&#39;)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;openWindow&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Opens a new browser window.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.openWindow( url )&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.openWindow(&#39;http://devexpress.github.io/testcafe&#39;)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.openWindow(&#39;./documentation&#39;);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;pressKey&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Presses the specified keyboard keys.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.pressKey(keys [, options])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.pressKey(&#39;h o m e home r i g h t right r i g h t right&#39;,{ speed: 0.1 })&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.pressKey(&#39;ctrl+a d e v 1 s p a c e space b a c k s p a c e backspace ctrl+a&#39;,{ speed: 1 })&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.pressKey(&#39;ctrl+a D E V 2 e n d end l e f t left c t r l + a ctrl+a delete a a a a backspace delete&#39;,{ speed: 1 })&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.pressKey(&#39;ctrl+a backspace&#39;,{ speed: 1 })&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Below are the various actions we can perform by using presskey&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&#39;backspace&#39;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&#39;tab&#39;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&#39;enter&#39;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&#39;capslock&#39;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&#39;esc&#39;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&#39;space&#39;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&#39;pageup&#39;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&#39;pagedown&#39;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&#39;end&#39;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&#39;home&#39;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&#39;left&#39;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&#39;right&#39;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&#39;up&#39;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&#39;down&#39;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&#39;ins&#39;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&#39;delete&#39;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;option: speed valued can be between 0.01 to 1&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;resizeWindow&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Resizes a window to fit the parameters entered by user&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.resizeWindow(width, height)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.resizeWindow(200, 100)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;resizeWindowToFitDevice&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Resizes the window to fit the screen of the specified mobile device.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Syntax&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.resizeWindowToFitDevice(deviceName [, options])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;eg.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.resizeWindowToFitDevice(&#39;Sony Xperia Z&#39;, {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; portraitOrientation: true&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; })&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&lt;b&gt; Remark&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; device name is configured in viewport-sizes.json file like below&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &quot;sonyxperiaz&quot;: {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &quot;portraitWidth&quot;: 360,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &quot;landscapeWidth&quot;: 640,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &quot;name&quot;: &quot;Sony Xperia Z&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; },&lt;/p&gt;&lt;p&gt;&amp;nbsp; All list of device name&lt;/p&gt;&lt;p&gt;&amp;nbsp; &lt;a href=&quot;https://github.com/DevExpress/device-specs/blob/master/viewport-sizes.json&quot;&gt;https://github.com/DevExpress/device-specs/blob/master/viewport-sizes.json&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;rightClick&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Right-clicks an element on a page.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.rightClick(selector [, options])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.rightClick(&#39;#cell-1-1&#39;)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;scroll&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Scrolls the target element to a specified position. If no target is specified, the document body is scrolled.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.scroll([target,] posX, posY[, options])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;and&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.scroll([target,] position[, options])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const container = Selector(&#39;#container&#39;);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.scroll(container, &#39;bottomRight&#39;);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;scrollBy&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Scrolls the target element by the specified number of pixels. If no target is specified, the document body is scrolled.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.scrollBy([target,] x, y[, options])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.scrollBy(500, -200);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;scrollIntoView&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Scrolls parent containers of the target element until the element is in the viewport.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.scrollIntoView(target [, options])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const target = Selector(&#39;#target&#39;);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.scrollIntoView(target);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;selectEditableContent&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Selects editable content on a web page.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.selectEditableContent(startSelector, endSelector [, options])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.selectEditableContent(&#39;#foreword&#39;, &#39;#chapter-3&#39;)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;selectText&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Selects text in input elements of various types.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.selectText(selector [, startPos] [, endPos] [, options])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const developerNameInput = Selector(&#39;#developer-name&#39;);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.selectText(developerNameInput, 7, 1);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;selectTextAreaContent&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Selects &amp;lt;textarea&amp;gt; content.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.selectTextAreaContent(selector [, startLine] [, startPos] [, endLine] [, endPos] [, options])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const commentTextArea = Selector(&#39;#comments&#39;);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.selectTextAreaContent(commentTextArea, 0, 5, 2, 10);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;setFilesToUpload&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Sets files to upload. Emulates a user’s selection in the browser’s ‘Choose File’ dialog.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.setFilesToUpload(selector, filePath)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.setFilesToUpload(&#39;#upload-input&#39;, [&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;./uploads/1.jpg&#39;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;./uploads/2.jpg&#39;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;./uploads/3.jpg&#39;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ])&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .click(&#39;#upload-button&#39;);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;setPageLoadTimeout&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Defines the time passed after the DOMContentLoaded event within which the window.load event should be raised.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.setPageLoadTimeout(duration)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.setPageLoadTimeout(0)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;setTestSpeed&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Specifies the test execution speed.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.setTestSpeed(factor)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.setTestSpeed(0.1)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;switchToIframe&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Switches to an &amp;lt;iframe&amp;gt;.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.switchToIframe(selector)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.switchToIframe(&#39;#iframe-1&#39;)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;switchToMainWindow&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Switches the test’s browsing context from an &amp;lt;iframe&amp;gt; back to the main window.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.switchToMainWindow()&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.switchToIframe(&#39;#iframe-1&#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;.click(&#39;#button-in-iframe-1&#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;.switchToMainWindow()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt; .click(&#39;#button-in-main-window&#39;);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;switchToParentWindow&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Activates the window that launched or was active when the active window was launched.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.switchToParentWindow()&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.openWindow(&#39;https://devexpress.com&#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt; .switchToParentWindow();&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;switchToPreviousWindow&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Activates the previously active window.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.switchToPreviousWindow()&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.openWindow(&#39;https://devexpress.com&#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;.switchToPreviousWindow();&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;switchToWindow&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Switches to a specific browser window.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.switchToWindow(windowDescriptor)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.switchToWindow(filterFn)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const homepage = await t.getCurrentWindow();&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;const documentation = await t.openWindow(&#39;http://devexpress.github.io/testcafe/documentation&#39;);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;await t.switchToWindow(homepage)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .switchToWindow(documentation);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;takeElementScreenshot&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Takes a screenshot of the specified page element.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.takeElementScreenshot(selector[, path][, options])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.takeElementScreenshot(Selector(&#39;fieldset&#39;).nth(1), &#39;my-fixture/important-features.png&#39;)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;takeScreenshot&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Takes screenshot of the entire page.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.takeScreenshot([options])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.takeScreenshot({&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; path:&amp;nbsp; &amp;nbsp; &amp;nbsp;&#39;my-fixture/thank-you-page.png&#39;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fullPage: true&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;typeText&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Types the specified text into an input element.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.typeText(selector, text [, options])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.typeText(nameInput, &#39;Peter&#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;.typeText(nameInput, &#39;Paker&#39;, { replace: true })&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;.typeText(nameInput, &#39;r&#39;, { caretPos: 2 })&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;.typeText(color, &#39;#FF8040&#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;.typeText(datetime, &#39;2017-11-03T05:00&#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt; .typeText(date, &#39;2017-11-03&#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;.typeText(time, &#39;15:30&#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;.typeText(month, &#39;2017-08&#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;.typeText(range, &#39;80&#39;);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;useRole&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Activates the role.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.useRole(role)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const registeredUser = Role(&#39;http://example.com/login&#39;, async t =&amp;gt; {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; await t&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .typeText(&#39;#login&#39;, &#39;username&#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .typeText(&#39;#password&#39;, &#39;pa$$w0rd&#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .click(&#39;#sign-in&#39;);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;});&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;test(&#39;My Test&#39;, async t =&amp;gt; {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; await t&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .useRole(registeredUser)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .expect(Selector(&#39;#avatar&#39;).visible).ok();&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;!--more--&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;wait&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Pauses a test for a specified period of time.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;t.wait(timeout)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;b&gt;eg.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;.wait(1000)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/999191580442518666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2021/05/test-cafe.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/999191580442518666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/999191580442518666'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2021/05/test-cafe.html' title='Test Cafe'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-6686323117307954853</id><published>2021-05-16T17:31:00.024+05:30</published><updated>2021-05-17T10:03:11.367+05:30</updated><title type='text'>SQL Queries Interview Questions </title><content type='html'>&lt;p&gt;&lt;b&gt;Q1. Second Highest salary of employee&lt;/b&gt;&lt;/p&gt;&lt;p&gt;select&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;distinct top 1 *&lt;/p&gt;&lt;p&gt;from&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;employees&lt;/p&gt;&lt;p&gt;where&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Salary &amp;lt; (Select MAX(Salary) from employees)&lt;/p&gt;&lt;p&gt;order by Salary desc&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;select&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;distinct top 1 *&lt;/p&gt;&lt;p&gt;from&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;employees&lt;/p&gt;&lt;p&gt;where&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Salary &amp;lt; (Select distinct top 1 salary from employees order by Salary desc)&lt;/p&gt;&lt;p&gt;order by Salary desc&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Select&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;top 1 *&lt;/p&gt;&lt;p&gt;from (&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Select distinct top 2 *&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;from&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;employees&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;order by Salary desc&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;) innerQuery&lt;/p&gt;&lt;p&gt;order by salary asc&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Select emp.*&lt;/p&gt;&lt;p&gt;from (&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Select *, row_number() OVER (Order by salary desc&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;) as rn from employees) innerQuery&lt;/p&gt;&lt;p&gt;inner join employees emp on emp.id = innerQuery.id&lt;/p&gt;&lt;p&gt;where innerQuery.rn =2&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q2. Select Third Highest Data&lt;/b&gt;&lt;/p&gt;&lt;p&gt;select&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;distinct top 1 *&lt;/p&gt;&lt;p&gt;from&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;(Select distinct top 3 * from employees order by salary desc) innerQuery&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;order by salary asc&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q3. Select Duplicate Data&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Select *&amp;nbsp;&lt;/p&gt;&lt;p&gt;from employees&lt;/p&gt;&lt;p&gt;where salary in&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;(&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Select salary from employees group by salary having count(salary) &amp;gt; 1&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;)&lt;/p&gt;&lt;p&gt;order by salary desc&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;select employees.*&lt;/p&gt;&lt;p&gt;from&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;(&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;select max(emp1.id) empId&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;from employees emp1&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;inner join employees emp2&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;on emp1.salary = emp2.salary&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;and emp1.id &amp;lt;&amp;gt; emp2.id&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;group by emp1.salary&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;) innerQuery&lt;/p&gt;&lt;p&gt;inner join employees&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;on innerQuery.empId = employees.id&lt;/p&gt;&lt;p&gt;order by employees.id&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q4. Delete Duplicate Data&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Delete&lt;/p&gt;&lt;p&gt;from employees&lt;/p&gt;&lt;p&gt;where id in (&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;Select max(id) from employees group by salary having count(salary) &amp;gt; 1&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Delete employees&lt;/p&gt;&lt;p&gt;from&lt;/p&gt;&lt;p&gt;(&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;select max(emp1.id) empId&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;from employees emp1&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;inner join employees emp2&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;on emp1.salary = emp2.salary&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;and emp1.id &amp;lt;&amp;gt; emp2.id&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;group by emp1.salary&lt;/p&gt;&lt;p&gt;) innerQuery&lt;/p&gt;&lt;p&gt;inner join employees&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;on innerQuery.empId = employees.id&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q5. Fetch monthly salary if annual salary is given&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Select *, salary/12 as monthlySalary from employees&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q6. How to fetch top 3 highest salary&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;select * from&amp;nbsp;&lt;/p&gt;&lt;p&gt;(Select *, row_number() over (order by salary desc) rn from employees) innerQuery&lt;/p&gt;&lt;p&gt;where innerQuery.rn &amp;lt;=3&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;select top 3 * from employees order by salary desc&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q7. Select employee details having odd id&lt;/b&gt;&lt;/p&gt;&lt;p&gt;select * from employees where id%2=1&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q8. Select employee details having even id&lt;/b&gt;&lt;/p&gt;&lt;p&gt;select * from employees where id%2=0&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q9.&amp;nbsp;How Can I create table with same structure of table without data&lt;/b&gt;&lt;/p&gt;&lt;p&gt;select * into NEW_TABLE from EXISTING_TABLE where 1=2&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q10.&amp;nbsp;How Can I create table with same structure of table with data&lt;/b&gt;&lt;/p&gt;&lt;p&gt;select * into NEW_TABLE from EXISTING_TABLE&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q11.&amp;nbsp;Display last 50% records from Employee table&lt;/b&gt;&lt;/p&gt;&lt;p&gt;select * from&lt;/p&gt;&lt;p&gt;(Select *,row_number() over(order by id) rn from employees) innerQuery&lt;/p&gt;&lt;p&gt;where innerQuery.rn &amp;gt;= (select count(id)/2 from employees)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q12.&amp;nbsp;How do I fetch only common records between 2 tables&lt;/b&gt;&lt;/p&gt;&lt;p&gt;select * from employees&lt;/p&gt;&lt;p&gt;intersect&lt;/p&gt;&lt;p&gt;select * from employees_new&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q13.&amp;nbsp;Find Query to get information of Employee where Employee is not assigned to the department&lt;/b&gt;&lt;/p&gt;&lt;p&gt;select * from employees where deptid not in (select id from department)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;select * from employees&lt;/p&gt;&lt;p&gt;except&lt;/p&gt;&lt;p&gt;select emp.* from employees emp&lt;/p&gt;&lt;p&gt;inner join department dep&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;on emp.deptid = dep.Id&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;select emp.* from employees emp&lt;/p&gt;&lt;p&gt;left join department dep&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;on emp.deptid = dep.Id&lt;/p&gt;&lt;p&gt;where dep.Id is null&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q14.&amp;nbsp;How to get distinct records from the table without using distinct keyword.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;select * from employees where id in (select max(id) from employees group by FirstName, LastName)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q15.&amp;nbsp;Select all records from Employee table whose name is ‘Jitendra’ and ‘Ram’&lt;/b&gt;&lt;/p&gt;&lt;p&gt;select * from employees where FirstName in (&#39;Jitendra&#39;, &#39;Ram&#39;)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q16.&amp;nbsp;How to fetch all the records from Employee whose joining year is&amp;nbsp; 2017&lt;/b&gt;&lt;/p&gt;&lt;p&gt;select * from employees where substring(convert(varchar,DOJ,103),7,4)=&#39;2017&#39;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;select * from employees where DOJ like &#39;2017%&#39;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q17.&amp;nbsp;What is SQL Query to find maximum salary of each department?&lt;/b&gt;&lt;/p&gt;&lt;p&gt;select max(emp.Salary), dep.DepartmentName from employees emp&lt;/p&gt;&lt;p&gt;inner join department dep&lt;/p&gt;&lt;p&gt;on emp.deptid = dep.Id&lt;/p&gt;&lt;p&gt;group by dep.DepartmentName&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;select max(emp.Salary), emp.deptid from employees emp group by emp.deptid&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q18.&amp;nbsp;How Do you find all Employees with its managers?&lt;/b&gt;&lt;/p&gt;&lt;p&gt;select emp.FirstName + &#39; &#39; + emp.LastName as EmpName, manager.FirstName + &#39; &#39; + manager.LastName as ManagerName&lt;/p&gt;&lt;p&gt;from employees emp, employees manager&lt;/p&gt;&lt;p&gt;where emp.ManagerId = manager.id&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;select emp.FirstName + &#39; &#39; + emp.LastName as EmpName, manager.FirstName + &#39; &#39; + manager.LastName as ManagerName&lt;/p&gt;&lt;p&gt;from employees emp&lt;/p&gt;&lt;p&gt;inner join employees manager&lt;/p&gt;&lt;p&gt;on emp.ManagerId = manager.id&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q19.&amp;nbsp;How to find count of duplicate rows&lt;/b&gt;&lt;/p&gt;&lt;p&gt;select FirstName, count(FirstName) cnt from employees group by FirstName, LastName, Location having count(FirstName) &amp;gt; 1&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q20.&amp;nbsp;How to Find the Joining date of Employee in YYYY-DAY-Date format.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;select SUBSTRING(CONVERT(VARCHAR, DOJ, 121), 1, 4) + &#39;-&#39; + SUBSTRING(CONVERT(VARCHAR, DOJ, 100), 1, 3) + &#39;-&#39; + SUBSTRING(CONVERT(VARCHAR, DOJ, 103), 1,2) from employees&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Q20.&amp;nbsp;Display current date in different format&lt;/b&gt;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 100) &#39;100&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 101) &#39;101&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 102) &#39;102&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 103) &#39;103&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 104) &#39;104&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 105) &#39;105&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 106) &#39;106&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 107) &#39;107&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 108) &#39;108&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 109) &#39;109&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 110) &#39;110&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 111) &#39;111&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 112) &#39;112&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 113) &#39;113&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 114) &#39;114&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 120) &#39;120&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 121) &#39;121&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 126) &#39;126&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 127) &#39;127&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 130) &#39;130&#39;&lt;/p&gt;&lt;p&gt;select CONVERT(VARCHAR, GETDATE(), 131) &#39;131&#39;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Output&lt;/b&gt;&lt;/p&gt;&lt;p&gt;May 16 2021 10:41PM&lt;/p&gt;&lt;p&gt;05/16/2021&lt;/p&gt;&lt;p&gt;2021.05.16&lt;/p&gt;&lt;p&gt;16/05/2021&lt;/p&gt;&lt;p&gt;16.05.2021&lt;/p&gt;&lt;p&gt;16-05-2021&lt;/p&gt;&lt;p&gt;16 May 2021&lt;/p&gt;&lt;p&gt;May 16, 2021&lt;/p&gt;&lt;p&gt;22:41:11&lt;/p&gt;&lt;p&gt;May 16 2021 10:41:11:850PM&lt;/p&gt;&lt;p&gt;05-16-2021&lt;/p&gt;&lt;p&gt;2021/05/16&lt;/p&gt;&lt;p&gt;20210516&lt;/p&gt;&lt;p&gt;16 May 2021 22:41:11:850&lt;/p&gt;&lt;p&gt;22:41:11:850&lt;/p&gt;&lt;p&gt;2021-05-16 22:41:11&lt;/p&gt;&lt;p&gt;2021-05-16 22:41:11.850&lt;/p&gt;&lt;p&gt;2021-05-16T22:41:11.850&lt;/p&gt;&lt;p&gt;2021-05-16T22:41:11.850&lt;/p&gt;&lt;p&gt;&amp;nbsp;5 ???? 1442 10:41:11:850PM&lt;/p&gt;&lt;p&gt;&amp;nbsp;5/10/1442 10:41:11:850PM&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/6686323117307954853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2021/05/interview-questions-queries.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/6686323117307954853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/6686323117307954853'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2021/05/interview-questions-queries.html' title='SQL Queries Interview Questions '/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-5314967614182266061</id><published>2021-05-16T15:57:00.010+05:30</published><updated>2021-05-17T10:06:01.945+05:30</updated><title type='text'>Oops Interview Question - 3</title><content type='html'>&lt;p&gt;&lt;b&gt;&amp;nbsp;52. What is the difference between a Hash Table and a Dictionary?&lt;/b&gt;&lt;/p&gt;&lt;table class=&quot;math-table&quot; style=&quot;background-color: white; border-collapse: collapse; border-spacing: 0px; border: 0px; color: #40424e; display: block; font-family: urw-din, sans-serif; font-size: 17px; letter-spacing: 0.162px; margin: 25px auto; overflow-x: scroll; padding: 0px; vertical-align: baseline; width: 1031.94px;&quot;&gt;&lt;tbody style=&quot;border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;tr style=&quot;background-color: var(--gfg-body-color); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;th style=&quot;background-color: #c6ebd9; border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-weight: 400; margin: 0px; padding: 8px; text-align: left; vertical-align: baseline;&quot;&gt;Hashtable&lt;/th&gt;&lt;th style=&quot;background-color: #c6ebd9; border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-weight: 400; margin: 0px; padding: 8px; text-align: left; vertical-align: baseline;&quot;&gt;Dictionary&lt;/th&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;tbody style=&quot;border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;tr style=&quot;background-color: var(--gfg-body-color); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;A Hashtable is a non-generic collection.&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;A Dictionary is a generic collection.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--gfg-darkgrey); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;Hashtable is defined under System.Collections namespace.&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;Dictionary is defined under System.Collections.Generic namespace.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--gfg-body-color); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;In Hashtable, you can store key/value pairs of the same type or of the different type.&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;In Dictionary, you can store key/value pairs of same type.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--gfg-darkgrey); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;In Hashtable, there is no need to specify the type of the key and value.&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;In Dictionary, you must specify the type of key and value.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--gfg-body-color); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;The data retrieval is slower than Dictionary due to boxing/ unboxing.&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;The data retrieval is faster than Hashtable due to no boxing/ unboxing.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--gfg-darkgrey); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;In Hashtable, if you try to access a key that doesn’t present in the given Hashtable, then it will give null values.&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;In Dictionary, if you try to access a key that doesn’t present in the given Dictionary, then it will give error.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--gfg-body-color); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;It is thread safe.&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;It is also thread safe but only for public static members.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--gfg-darkgrey); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;It doesn’t maintain the order of stored values.&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;It always maintain the order of stored values.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;b&gt;&lt;br /&gt;Example Hash Table&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;background-color: #9900ff; color: #f0e6ff; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.524px;&quot;&gt;&lt;div class=&quot;line number2 index1 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;using&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;System;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number3 index2 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;using&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;System.Collections;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number4 index3 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&lt;/code&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number5 index4 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;class&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;GFG {&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number6 index5 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&lt;/code&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number7 index6 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; clear: both; color: #008200; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;// Main method&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number8 index7 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;static&lt;/code&gt; &lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;void&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;Main()&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number9 index8 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;{&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number10 index9 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&lt;/code&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number11 index10 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; clear: both; color: #008200; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;// Create a hashtable&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number12 index11 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; clear: both; color: #008200; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;// Using Hashtable class&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number13 index12 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;Hashtable my_hashtable = &lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;new&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;Hashtable();&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number14 index13 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&lt;/code&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number15 index14 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; clear: both; color: #008200; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;// Adding key/value pair in the hashtable&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number16 index15 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; clear: both; color: #008200; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;// Using Add() method&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number17 index16 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;my_hashtable.Add(&lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: blue; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&quot;A1&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: blue; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&quot;Welcome&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number18 index17 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;my_hashtable.Add(&lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: blue; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&quot;A2&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: blue; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&quot;to&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number19 index18 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;my_hashtable.Add(&lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: blue; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&quot;A3&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: blue; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&quot;GeeksforGeeks&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number20 index19 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&lt;/code&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number21 index20 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;foreach&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;(DictionaryEntry element &lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;in&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;my_hashtable)&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number22 index21 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;{&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number23 index22 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;Console.WriteLine(&lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: blue; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&quot;Key:- {0} and Value:- {1} &quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;,&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number24 index23 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;element.Key, element.Value);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number25 index24 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;}&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number26 index25 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;}&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number27 index26 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;}&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;line number27 index26 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number27 index26 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: var(--font-din); height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&lt;p style=&quot;border: 0px; box-sizing: border-box; color: #40424e; font-family: urw-din, sans-serif; font-size: 17px; letter-spacing: 0.162px; margin: 0px 0px 10px; padding: 0px; vertical-align: baseline; white-space: normal;&quot;&gt;&lt;strong style=&quot;border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Output:&lt;/strong&gt;&lt;/p&gt;&lt;pre style=&quot;background-color: var(--gfg-grey-bg); border-radius: 10px; border: 0px; box-sizing: border-box; color: var(--color-black); font-family: Consolas, monospace; font-size: 12pt; letter-spacing: 0.162px; margin-bottom: 10px; margin-top: 0px; overflow: auto; padding: 20px; vertical-align: baseline;&quot;&gt;Key:- A3 and Value:- GeeksforGeeks 
Key:- A2 and Value:- to 
Key:- A1 and Value:- Welcome &lt;/pre&gt;&lt;/code&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;Example Dictionary&lt;/b&gt;&lt;/p&gt;&lt;div class=&quot;line number2 index1 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;using&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;System;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number3 index2 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;using&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;System.Collections.Generic;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number4 index3 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&lt;/code&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number5 index4 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;class&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;GFG {&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number6 index5 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&lt;/code&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number7 index6 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; clear: both; color: #008200; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;// Main Method&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number8 index7 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;static&lt;/code&gt; &lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;void&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;Main()&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number9 index8 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;{&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number10 index9 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&lt;/code&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number11 index10 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; clear: both; color: #008200; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;// Creating a dictionary&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number12 index11 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; clear: both; color: #008200; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;// using Dictionary&amp;lt;TKey, TValue&amp;gt; class&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number13 index12 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;Dictionary&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;string&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;string&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;gt; My_dict =&amp;nbsp;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number14 index13 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;new&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;Dictionary&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;string&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;string&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;gt;();&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number15 index14 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&lt;/code&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number16 index15 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; clear: both; color: #008200; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;// Adding key/value pairs in the Dictionary&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number17 index16 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;comments&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; clear: both; color: #008200; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;// Using Add() method&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number18 index17 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;My_dict.Add(&lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: blue; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&quot;a.01&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: blue; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&quot;C&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number19 index18 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;My_dict.Add(&lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: blue; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&quot;a.02&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: blue; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&quot;C++&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number20 index19 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;My_dict.Add(&lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: blue; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&quot;a.03&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: blue; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&quot;C#&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number21 index20 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&lt;/code&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number22 index21 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;foreach&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;(KeyValuePair&amp;lt;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;string&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;string&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;gt; element &lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; font-weight: 700; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;in&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;My_dict)&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number23 index22 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;{&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number24 index23 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;Console.WriteLine(&lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: blue; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&quot;Key:- {0} and Value:- {1}&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;,&amp;nbsp;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number25 index24 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;element.Key, element.Value);&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number26 index25 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;}&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number27 index26 alt2&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;undefined spaces&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;}&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number28 index27 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;}&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number28 index27 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number28 index27 alt1&quot; style=&quot;background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #40424e; direction: ltr; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; letter-spacing: 0.162px; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px 1em 0px 0px; position: static; vertical-align: baseline; white-space: pre; width: auto;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: 0px 0px; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 11pt; height: auto; inset: auto; line-height: 1.2em; margin: 0px; min-height: auto; outline: 0px; overflow: auto hidden; padding: 0px; position: static; vertical-align: baseline; width: auto;&quot;&gt;&lt;p style=&quot;border: 0px; box-sizing: border-box; color: #40424e; font-family: urw-din, sans-serif; font-size: 17px; letter-spacing: 0.162px; margin: 0px 0px 10px; padding: 0px; vertical-align: baseline; white-space: normal;&quot;&gt;&lt;strong style=&quot;border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Output:&lt;/strong&gt;&lt;/p&gt;&lt;pre style=&quot;background-color: var(--gfg-grey-bg); border-radius: 10px; border: 0px; box-sizing: border-box; color: var(--color-black); font-family: Consolas, monospace; font-size: 12pt; letter-spacing: 0.162px; margin-bottom: 10px; margin-top: 0px; overflow: auto; padding: 20px; vertical-align: baseline;&quot;&gt;Key:- a.01 and Value:- C
Key:- a.02 and Value:- C++
Key:- a.03 and Value:- C#&lt;/pre&gt;&lt;/code&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;53. What are the state management techniques used in .Net?&lt;/b&gt;&lt;/p&gt;&lt;p&gt;HTTP Protocol is a Stateless protocol HTTP/HTTPs doesn&#39;t remember what website or URL we visited, or in other words we can say it doesn&#39;t hold the state of a previous website that we visited before closing our browser, that is called stateless. So how to maintain the state for request. This is called state management.&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAJqspJWpkZg_IVLHgJ1OyXphMzyQGddeqmuBKLCWs-RiYzCPcWRSQJxGLJ4-iL4iZnLMs-dEXK9KUZEfefFpOJC3NXyEDSC7yUpvTU8bj0camLKIRDMZ7grY-B2v8i0K60r8HD0CLipZs/s623/State+Management+Techniques.jpg&quot; style=&quot;font-weight: 700; margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;331&quot; data-original-width=&quot;623&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAJqspJWpkZg_IVLHgJ1OyXphMzyQGddeqmuBKLCWs-RiYzCPcWRSQJxGLJ4-iL4iZnLMs-dEXK9KUZEfefFpOJC3NXyEDSC7yUpvTU8bj0camLKIRDMZ7grY-B2v8i0K60r8HD0CLipZs/s320/State+Management+Techniques.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;State Management&amp;nbsp;Types&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Client-side Management&lt;/li&gt;&lt;li&gt;Server-side Management&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Client-side Techniques&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Client-Side State Management, the state related information will directly get stored on the client-side. That specific information will travel back and communicate with every request generated by the user then afterwards provides responses after server-side communication.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;View&lt;/li&gt;&lt;li&gt;Hidden&lt;/li&gt;&lt;li&gt;Cookies&lt;/li&gt;&lt;li&gt;Control State&lt;/li&gt;&lt;li&gt;Query Strings&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Server-side Techniques&lt;/b&gt;&lt;/p&gt;&lt;p&gt;In Server-Side State Management all the information is stored in the user memory. Due to this functionality there is more secure domains at the server side in comparison to Client-Side State Management.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Session State&lt;/li&gt;&lt;li&gt;Application State&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;View State&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;It is page-level State Management&lt;/li&gt;&lt;li&gt;Used for holding data temporarily&lt;/li&gt;&lt;li&gt;Can store any type of data&lt;/li&gt;&lt;li&gt;Property dependent&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;b&gt;Hidden Fields&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Contains a small amount of memory&lt;/li&gt;&lt;li&gt;Direct functionality access&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;b&gt;Cookies&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Store information temporarily&lt;/li&gt;&lt;li&gt;It&#39;s just a simple small sized text file&lt;/li&gt;&lt;li&gt;Can be changed depending on requirements&lt;/li&gt;&lt;li&gt;User Preferred&lt;/li&gt;&lt;li&gt;Requires only a few bytes or KBs of space for creating cookies&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Query String/Parameter&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;It is generally used for holding values&lt;/li&gt;&lt;li&gt;Works temporarily&lt;/li&gt;&lt;li&gt;Switches info from one to another page&lt;/li&gt;&lt;li&gt;Increase performance&lt;/li&gt;&lt;li&gt;Uses real and virtual path values for URL routing&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Session State&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;The Session basically stores the values as a dictionary collection in key/value pairs.&amp;nbsp;It completely utilizes server resources to store the data. It is a secure way of storing data, since the data will never be passed to the client.&lt;/p&gt;&lt;p&gt;For each and every user, a separate Session is created, and each and every Session has its Unique ID. This ID is being stored in the client&#39;s machine using cookies. If there are multiple users who are accessing a web application, then for each user a separate Session is created. If a single user logs in and logs out the Session is killed, then if the same user again logs into the application, then a new Session ID is being created for the same user.&lt;/p&gt;&lt;p&gt;The Session has a default timeout value (20 minutes). We can also set the timeout value for a session in the web.config file.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;54. What is Data Abstraction?&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Data abstraction is the process of hiding certain details and showing only essential information to the user. Abstraction can be achieved with either abstract classes or interfaces&lt;/p&gt;&lt;p&gt;The abstract keyword is used for classes and methods&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;55. What is Abstract Class?&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Abstract class is a restricted class that cannot be used to create objects (cannot be instantiated).&lt;/li&gt;&lt;li&gt;To access it, it must be inherited from another class).&lt;/li&gt;&lt;li&gt;This class must contain at least one abstract method.&lt;/li&gt;&lt;li&gt;The Abstract classes are typically used to define a base class in the class hierarchy.&lt;/li&gt;&lt;li&gt;Abstract classes are either partially implemented or not implemented at all.&lt;/li&gt;&lt;li&gt;You can take advantage of abstract classes to design components and specify some level of common functionality that must be implemented by derived classes.&lt;/li&gt;&lt;li&gt;An abstract class can have both abstract and regular methods.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/p&gt;&lt;p&gt;abstract class Animal&amp;nbsp;&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp; public abstract void animalSound();&lt;/p&gt;&lt;p&gt;&amp;nbsp; public void sleep()&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Zzz&quot;);&lt;/p&gt;&lt;p&gt;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Animal myObj = new Animal(); // Will generate an error (Cannot create an instance of the abstract class or interface &#39;Animal&#39;)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;56. What is Abstract Method?&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Abstract method can only be used in an abstract class, and it does not have a body.&lt;/li&gt;&lt;li&gt;The body is provided by the derived class (inherited from).&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;57. What is Interface?&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;An interface is a completely &quot;abstract class&quot;, which can only contain abstract methods and properties (with empty bodies)&lt;/li&gt;&lt;li&gt;By default, members of an interface are abstract and public.&lt;/li&gt;&lt;li&gt;Interfaces can contain properties and methods, but not fields.&lt;/li&gt;&lt;li&gt;Interface methods do not have a body - the body is provided by the &quot;implement&quot; class&lt;/li&gt;&lt;li&gt;On implementation of an interface, you must override all of its methods&lt;/li&gt;&lt;li&gt;An interface cannot contain a constructor (as it cannot be used to create objects)&lt;/li&gt;&lt;li&gt;An interface is a group of related methods with empty bodies.&amp;nbsp;&lt;/li&gt;&lt;li&gt;C# does not support &quot;multiple inheritance&quot; (a class can only inherit from one base class). However, it can be achieved with interfaces, because the class can implement multiple interfaces.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/p&gt;&lt;p&gt;interface Animal&amp;nbsp;&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp; void animalSound(); // interface method (does not have a body)&lt;/p&gt;&lt;p&gt;&amp;nbsp; void run(); // interface method (does not have a body)&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;58. What is the difference between Abstract class and Interface?&lt;/b&gt;&lt;/p&gt;&lt;table class=&quot;math-table&quot; style=&quot;background-color: white; border-collapse: collapse; border-spacing: 0px; border: 0px; color: #40424e; display: block; font-family: urw-din, sans-serif; font-size: 17px; letter-spacing: 0.162px; margin: 25px auto; overflow-x: scroll; padding: 0px; vertical-align: baseline; width: 671.844px;&quot;&gt;&lt;tbody style=&quot;border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;tr style=&quot;background-color: var(--gfg-body-color); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;th style=&quot;background-color: #c6ebd9; border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-weight: 400; margin: 0px; padding: 8px; text-align: left; vertical-align: baseline;&quot;&gt;Abstract Class&lt;/th&gt;&lt;th style=&quot;background-color: #c6ebd9; border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-weight: 400; margin: 0px; padding: 8px; text-align: left; vertical-align: baseline;&quot;&gt;Interface&lt;/th&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;tbody style=&quot;border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;tr style=&quot;background-color: var(--gfg-body-color); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;It contains both declaration and definition part.&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;It contains only a declaration part.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--gfg-darkgrey); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;Multiple inheritance is not achieved by abstract class.&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;Multiple inheritance is achieved by interface.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--gfg-body-color); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;It contain&amp;nbsp;constructor.&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;It does not contain&amp;nbsp;constructor.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--gfg-darkgrey); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;It can contain static members.&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;It does not contain static members.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--gfg-body-color); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;open sans&amp;quot;, sans-serif; font-size: 16px; letter-spacing: normal;&quot;&gt;Abstract class members can have access modifiers.&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;open sans&amp;quot;, sans-serif; font-size: 16px; letter-spacing: normal;&quot;&gt;Interface members can’t have access modifiers.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--gfg-darkgrey); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;open sans&amp;quot;, sans-serif; font-size: 16px; letter-spacing: normal;&quot;&gt;Abstract class members can be private by default which can be change.&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;open sans&amp;quot;, sans-serif; font-size: 16px; letter-spacing: normal;&quot;&gt;Interface members can be public by default which can not be change.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--gfg-body-color); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;open sans&amp;quot;, sans-serif; font-size: 16px; letter-spacing: normal;&quot;&gt;Abstract class can inherit from another abstract class or another interface.&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;open sans&amp;quot;, sans-serif; font-size: 16px; letter-spacing: normal;&quot;&gt;Interface can inherit from another interface only and cannot inherit from an abstract class.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--gfg-darkgrey); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;A class can only use one abstract class.&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;A class can use multiple interface.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--gfg-body-color); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;If many implementations are of the same kind and use common behavior, then it is superior to use abstract class.&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;If many implementations only share methods, then it is superior to use Interface.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--gfg-darkgrey); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;Abstract class can contain methods, fields, constants, etc.&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;Interface can only contain methods .&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--gfg-body-color); border: 0px; box-sizing: border-box; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;It can be fully, partially or not implemented.&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(95, 185, 98); box-sizing: border-box; font-size: 12.5pt; margin: 0px; padding: 14px 10px; vertical-align: baseline;&quot;&gt;It should be fully implemented.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;b&gt;How to create Abstract Classes and Interfaces? &lt;/b&gt;&lt;p&gt;public abstract class Customer&amp;nbsp;&amp;nbsp;&lt;/p&gt;{  &lt;br /&gt;&lt;br /&gt;}  &lt;p&gt;public interface ICustomer&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;{&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;How to create Abstract Classes and Interfaces along with fields?&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;public abstract class Customer&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;{&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; int i1;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;public interface ICustomer&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;{&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; int i2;//Not possible&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;How to create Abstract Classes and Interfaces along with members?&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;public abstract class Customer&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;{&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; public abstract void Print1();&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;public interface ICustomer&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;{&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; void Print2();&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;How ismember implementation possible in Abstract Classes and Interfaces?&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;public abstract class Customer&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;{&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; public void Print1()&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; {&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;public interface ICustomer&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;{&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; void Print2()//Not possible&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; {&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;How to implement abstract or interface members in inherited class?&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;public abstract class Customer&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;{&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; public abstract void Print1();&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;public interface ICustomer&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;{&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; void Print2();&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;public class MainClass : Customer, ICustomer&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;{&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; public override void Print1()&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; {&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; public void Print2()&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; {&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;How to implement inherit from another Abstract Class or Interface to Abstract Class or Interface?&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;public abstract class Customer1&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;{&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;public abstract class Customer2 : Customer1&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;{&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;public abstract class Customer3 : Customer1, ICustomer1&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;{&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;public interface ICustomer1&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;{&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;public interface ICustomer2 : ICustomer1&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;{&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;public interface ICustomer3 : Customer1 //Not possible&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;{&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/5314967614182266061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2021/05/oops-interview-question-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/5314967614182266061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/5314967614182266061'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2021/05/oops-interview-question-3.html' title='Oops Interview Question - 3'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAJqspJWpkZg_IVLHgJ1OyXphMzyQGddeqmuBKLCWs-RiYzCPcWRSQJxGLJ4-iL4iZnLMs-dEXK9KUZEfefFpOJC3NXyEDSC7yUpvTU8bj0camLKIRDMZ7grY-B2v8i0K60r8HD0CLipZs/s72-c/State+Management+Techniques.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-1018278168073614526</id><published>2021-03-19T23:27:00.012+05:30</published><updated>2021-06-07T21:53:37.596+05:30</updated><title type='text'>Other Tech</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://ddevblog1.blogspot.com/2021/03/docker.html&quot;&gt;Docker&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://youtu.be/ydcZGnZas-I&quot; target=&quot;_blank&quot;&gt;JSONata&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://ddevblog1.blogspot.com/2021/05/test-cafe.html&quot;&gt;TestCafe&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://ddevblog1.blogspot.com/2019/02/javascript.html&quot;&gt;JavaScript&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://ddevblog1.blogspot.com/2018/06/c.html&quot;&gt;HTML5&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://ddevblog1.blogspot.com/2020/05/json-vs-cson-vs-xml-vs-yaml.html&quot;&gt;JSON VS CSON VS XML VS YAML&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://ddevblog1.blogspot.com/2020/08/git-commands.html&quot;&gt;GIT Commands&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/1018278168073614526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2021/03/other-tech.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/1018278168073614526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/1018278168073614526'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2021/03/other-tech.html' title='Other Tech'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-6790600192550032114</id><published>2021-03-19T21:04:00.020+05:30</published><updated>2021-03-27T14:27:46.393+05:30</updated><title type='text'>Docker</title><content type='html'>&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;h2 style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;u&gt;Docker Basic Commands&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;/h2&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker -v &lt;span style=&quot;color: #ffd966;&quot;&gt;--- Show Docker version&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker --version&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- Show&amp;nbsp;Docker version&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker or docker --help&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- Show&amp;nbsp;Docker all commands&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker pull image_name&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;---&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #ffd966;&quot;&gt;Pull an image or a repository from a registry&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker pull image_name:tab&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;---&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #ffd966;&quot;&gt;Pull an image or a repository from a registry&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker pull --all-tabs image_name:tab&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;---&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #ffd966;&quot;&gt;Pull an image or a repository from a registry with multiple images&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker start container_name&lt;span style=&quot;color: #ffd966;&quot;&gt;---&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #ffd966;&quot;&gt;Start one or more stopped containers&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;docker start -a container_name &lt;span style=&quot;color: #ffd966;&quot;&gt;--- attached running container&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker start -i container_name &lt;span style=&quot;color: #ffd966;&quot;&gt;--- Attach container&#39;s STDIN&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker run image_name&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- Start a container from an image -- attached mode&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker run -d image_name&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- run in back end (run in detached mode)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker run image_name:tag&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- tag is version by default docker pick latest version&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker run image_name&amp;nbsp; sleep 5&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- sleep after 5 seconds&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker run&amp;nbsp;&lt;span&gt;--name Provide_new_name image_name&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp; &amp;nbsp;--- Set container name&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker run -i image_name&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- prompt interactive mode&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker run -it image_name&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffe599;&quot;&gt;--- prompt interactive mode in terminal&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker run -p 80:5000 image_name&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- traffic on port 80 on docker host will get routed to port 5000 inside the docker contain&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker run -v /opt/datadir:/var/lib/mysql image_name&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- /opt/datadir is the outside container where you want to save your container related data&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker run -e APP_COLOR=blue image_name&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- set environment variable&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker run --network=none image_name&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- run container on network none&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker run --network=host image_name&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- run container on network host&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker run -v data_volume:/var/lib/mysql mysql&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- mount volume&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker run -d -e MYSQL_ROOT_PASSWORD=db_pass123 --name mysql-db --network wp-mysql-network mysql:5.6&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- run container and adding network and environment variable&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span style=&quot;color: #ffd966;&quot;&gt;run = pull + start&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffd966;&quot;&gt;CTRL + C stop running&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;docker exec container_name command [Arg...]&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;---&amp;nbsp;&lt;/span&gt;Run a command in a running container&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker ps &lt;span style=&quot;color: #ffd966;&quot;&gt;--- list running containers&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker ps -a &lt;span style=&quot;color: #ffd966;&quot;&gt;--- list all containers (running or stopping)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker ps -q&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- list all containers id&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker ps | grep test&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- list all containers and filter with name test&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker ps --last 1&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;---&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #ffd966;&quot;&gt;Show n last created containers (includes all states)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker ps --latest&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- Show the latest created container (includes all states)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker ps -s&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;---&amp;nbsp;Display total file sizes&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker ps -f &quot;status=exited&quot;&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp;--- filtering flag&amp;nbsp;with status&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker ps -a -f exited=1&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp;--- filtering flag&amp;nbsp;with status exited&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker ps -f id=39b7876aa786&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp;--- filtering flag&amp;nbsp;with id&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker ps -f name=nginx&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp;--- filtering flag&amp;nbsp;with name&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker images&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- list of running images&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker images -a&lt;span style=&quot;color: #ffd966;&quot;&gt; --- list of all images&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker images --digests&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp;--- list of digests images&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker images --no-trunc&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp;--- list of digests images without truncate output&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker images -f &quot;before=image_name&quot;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp;---&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;filter shows only images created before the image with given id or reference&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker images -f &quot;since=image_name&quot;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp;---&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;filter shows only images created after the image with given id or reference&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker images -f&amp;nbsp; &quot;dangling=true&quot;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp;---&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;show un-tagged&amp;nbsp;images&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker tag image_id new_image_name&lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp; &amp;nbsp;--- renaming the image name&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker stop container_name or container_id &lt;span style=&quot;color: #ffd966;&quot;&gt;--- stop running container&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker rm container_name or container_id &lt;span style=&quot;color: #ffd966;&quot;&gt;--- remove container&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker rmi container_name &lt;span style=&quot;color: #ffd966;&quot;&gt;--- remove image&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker rmi $(docker images -f &quot;dangling=true&quot; -q)&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- remove image using filter un-tagged images&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;docker port container_id&lt;/span&gt;&lt;span style=&quot;color: #ffd966;&quot;&gt; --- check the port number for the container&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;docker kill container_name&lt;/span&gt;&lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp; ---&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp;Force stop containers.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker attach docker_container &lt;span style=&quot;color: #ffd966;&quot;&gt;--- run in front end&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker logs container_name&lt;span style=&quot;color: #ffd966;&quot;&gt; --- view specified container related logs&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker inspect container_name&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt; --- find details for specific container&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker build Dockerfile -t image_name &lt;span style=&quot;color: #ffd966;&quot;&gt;--- build docker image&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker push image_name&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- push docker image to repository/hub&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker history image_name&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- Find the history of image&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker network ls&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- list all networks&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker network inspect network_name&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- inspect network details&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker network create --driver bridge --subnet 182.18.0.1/24 --gateway 182.18.0.1 image_name&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- create network and adding driver, subnet and gateway&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker volume create data_volume &lt;span style=&quot;color: #ffd966;&quot;&gt;--- create docker volume&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker service create --replicas=3 my-web-server&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- create number of replicas&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;docker commit existing_container_id&amp;nbsp; new_image_name&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;---&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #ffd966;&quot;&gt;Create a new image from a container’s changes&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;docker commit --change &quot;ENV DEBUG=true&quot; existing_container_name&amp;nbsp; new_image_name&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- new configuration&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker commit --change=&#39;CMD [&quot;apachectl&quot;, &quot;-DFOREGROUND&quot;]&#39; -c &quot;EXPOSE 80&quot; existing_container_name&amp;nbsp; new_image_name&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- commit container with cmd and expose instuction&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker service create --replicas=3 my-web-server&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- create number of replicas&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker cp container: source_path destination_path&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt; --- Copy files/folders between a container and the local filesystem&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;dcoker create image_name &lt;span style=&quot;color: #ffd966;&quot;&gt;--- Create a new container&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;docker diff container&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- Inspect changes to files or directories on a container’s filesystem&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;docker export container&lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp; --- Export a container’s filesystem as a tar archive&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker image ls&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- list images&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker image pull&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- Pull an image or a repository from a registry&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker image push&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- Push an image or a repository to a registry&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker image inspect&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- Display detailed information on one or more images&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker image history&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- Show the history of an image&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker image build&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- Build an image from a Dockerfile&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker image rm&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- Remove one or more images&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker images &lt;span style=&quot;color: #ffd966;&quot;&gt;--- List images&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker login &lt;span style=&quot;color: #ffd966;&quot;&gt;--- Log in to a Docker registry&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker lgout &lt;span style=&quot;color: #ffd966;&quot;&gt;--- Log out from Docker registry&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker logs container&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- fetch the logs of a container&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;docker system df &lt;span style=&quot;color: #ffd966;&quot;&gt;--- image container details summary&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docekr stats&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt; &amp;nbsp;--- docker stats&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker network connect network_name container_name&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt; --- Connect a container to a network&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker network disconnect network_name container_name&lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp; --- Disconnect a container from a network&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker network create network_name&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- Create a network&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker network inspect network_name&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt; --- Display detailed information on one or more networks&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker network ls &lt;span style=&quot;color: #ffd966;&quot;&gt;-- list networks&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker network rm network_name &lt;span style=&quot;color: #ffd966;&quot;&gt;--- Remove one or more networks&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker rename container_name new_Container_name&lt;span style=&quot;color: #ffd966;&quot;&gt; --- Rename a container&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker restart container_name &lt;span style=&quot;color: #ffd966;&quot;&gt;--- Restart one or more containers&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span style=&quot;color: #ffd966;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;h2 style=&quot;text-align: center;&quot;&gt;&lt;u&gt;Docker Commands Details&lt;/u&gt;&lt;/h2&gt;&lt;div&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Commands:&lt;/div&gt;&lt;div&gt;&amp;nbsp; attach&amp;nbsp; &amp;nbsp; &amp;nbsp; Attach local standard input, output, and error streams to a running container&lt;/div&gt;&lt;div&gt;&amp;nbsp; build&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Build an image from a Dockerfile&lt;/div&gt;&lt;div&gt;&amp;nbsp; commit&amp;nbsp; &amp;nbsp; &amp;nbsp; Create a new image from a container&#39;s changes&lt;/div&gt;&lt;div&gt;&amp;nbsp; cp&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Copy files/folders between a container and the local filesystem&lt;/div&gt;&lt;div&gt;&amp;nbsp; create&amp;nbsp; &amp;nbsp; &amp;nbsp; Create a new container&lt;/div&gt;&lt;div&gt;&amp;nbsp; diff&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Inspect changes to files or directories on a container&#39;s filesystem&lt;/div&gt;&lt;div&gt;&amp;nbsp; events&amp;nbsp; &amp;nbsp; &amp;nbsp; Get real time events from the server&lt;/div&gt;&lt;div&gt;&amp;nbsp; exec&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Run a command in a running container&lt;/div&gt;&lt;div&gt;&amp;nbsp; export&amp;nbsp; &amp;nbsp; &amp;nbsp; Export a container&#39;s filesystem as a tar archive&lt;/div&gt;&lt;div&gt;&amp;nbsp; history&amp;nbsp; &amp;nbsp; &amp;nbsp;Show the history of an image&lt;/div&gt;&lt;div&gt;&amp;nbsp; images&amp;nbsp; &amp;nbsp; &amp;nbsp; List images&lt;/div&gt;&lt;div&gt;&amp;nbsp; import&amp;nbsp; &amp;nbsp; &amp;nbsp; Import the contents from a tarball to create a filesystem image&lt;/div&gt;&lt;div&gt;&amp;nbsp; info&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Display system-wide information&lt;/div&gt;&lt;div&gt;&amp;nbsp; inspect&amp;nbsp; &amp;nbsp; &amp;nbsp;Return low-level information on Docker objects&lt;/div&gt;&lt;div&gt;&amp;nbsp; kill&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Kill one or more running containers&lt;/div&gt;&lt;div&gt;&amp;nbsp; load&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Load an image from a tar archive or STDIN&lt;/div&gt;&lt;div&gt;&amp;nbsp; login&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Log in to a Docker registry&lt;/div&gt;&lt;div&gt;&amp;nbsp; logout&amp;nbsp; &amp;nbsp; &amp;nbsp; Log out from a Docker registry&lt;/div&gt;&lt;div&gt;&amp;nbsp; logs&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Fetch the logs of a container&lt;/div&gt;&lt;div&gt;&amp;nbsp; pause&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Pause all processes within one or more containers&lt;/div&gt;&lt;div&gt;&amp;nbsp; port&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; List port mappings or a specific mapping for the container&lt;/div&gt;&lt;div&gt;&amp;nbsp; ps&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; List containers&lt;/div&gt;&lt;div&gt;&amp;nbsp; pull&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pull an image or a repository from a registry&lt;/div&gt;&lt;div&gt;&amp;nbsp; push&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Push an image or a repository to a registry&lt;/div&gt;&lt;div&gt;&amp;nbsp; rename&amp;nbsp; &amp;nbsp; &amp;nbsp; Rename a container&lt;/div&gt;&lt;div&gt;&amp;nbsp; restart&amp;nbsp; &amp;nbsp; &amp;nbsp;Restart one or more containers&lt;/div&gt;&lt;div&gt;&amp;nbsp; rm&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Remove one or more containers&lt;/div&gt;&lt;div&gt;&amp;nbsp; rmi&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Remove one or more images&lt;/div&gt;&lt;div&gt;&amp;nbsp; run&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Run a command in a new container&lt;/div&gt;&lt;div&gt;&amp;nbsp; save&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Save one or more images to a tar archive (streamed to STDOUT by default)&lt;/div&gt;&lt;div&gt;&amp;nbsp; search&amp;nbsp; &amp;nbsp; &amp;nbsp; Search the Docker Hub for images&lt;/div&gt;&lt;div&gt;&amp;nbsp; start&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Start one or more stopped containers&lt;/div&gt;&lt;div&gt;&amp;nbsp; stats&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Display a live stream of container(s) resource usage statistics&lt;/div&gt;&lt;div&gt;&amp;nbsp; stop&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Stop one or more running containers&lt;/div&gt;&lt;div&gt;&amp;nbsp; tag&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE&lt;/div&gt;&lt;div&gt;&amp;nbsp; top&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Display the running processes of a container&lt;/div&gt;&lt;div&gt;&amp;nbsp; unpause&amp;nbsp; &amp;nbsp; &amp;nbsp;Unpause all processes within one or more containers&lt;/div&gt;&lt;div&gt;&amp;nbsp; update&amp;nbsp; &amp;nbsp; &amp;nbsp; Update configuration of one or more containers&lt;/div&gt;&lt;div&gt;&amp;nbsp; version&amp;nbsp; &amp;nbsp; &amp;nbsp;Show the Docker version information&lt;/div&gt;&lt;div&gt;&amp;nbsp; wait&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Block until one or more containers stop, then print their exit codes&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/div&gt;&lt;div&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: center;&quot;&gt;&lt;u&gt;Form a Docker Compose File From Docker Command&lt;/u&gt;&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/div&gt;&lt;div&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Below are the docker commands&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;docker run -d --name=redis redis&lt;/div&gt;&lt;div&gt;docker run -d --name=db postgres:9.4&lt;/div&gt;&lt;div&gt;docker run -d --name=vote -p 5000:80 --link redis:redis voting-app&lt;/div&gt;&lt;div&gt;docker run -d --name=result -p 5001:80 --link db:db result-app&lt;/div&gt;&lt;div&gt;docker run -d --name=worker --link db:db --link redis:redis worker&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;i&gt;&lt;u&gt;Note:&lt;/u&gt;&lt;/i&gt; link can be simply notify as&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;--link db:db&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;--link db&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Compose Docker file from above commands&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;docker-compose.yml&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;------------------------------&lt;/b&gt;&lt;/div&gt;&lt;div&gt;version:&lt;/div&gt;&lt;div&gt;&lt;div&gt;redis:&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;image: redis&lt;/div&gt;&lt;div&gt;db:&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;image: postgres:9.4&lt;/div&gt;&lt;div&gt;vote:&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;build: ./vote&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;port:&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;-&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;5000:80&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;links:&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;-&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;redis&lt;/div&gt;&lt;div&gt;result:&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;build: ./result&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;ports:&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;-&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;5001:80&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;links:&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;-&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;db&lt;/div&gt;&lt;div&gt;worker:&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;build: ./worker&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;links:&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;-&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;redis&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;-&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;db&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;u&gt;Docker Compose Commands&lt;/u&gt;&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;docker compose create service_name&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- Creates containers for a service.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker compose convert one --format yaml&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp;--- Converts the compose file to platform’s yaml format&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker compose convert one --format json&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- Converts the compose file to platform’s json format&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker compose down&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- Stop and remove containers, networks&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker compose exec service_name command&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- run command&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker compose kill service_name&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- Force stop service containers.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker compose ls&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- List running compose projects&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker compose ps&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp;--- list containers&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker compose pull service_name&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- pull service images&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker compose push service_name&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- push service images&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker compose rm service_name&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- Removes stopped service containers&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker compose run service_name&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- Run a one-off command on a service.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker compose start service_name&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- Start services&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker compose stop service_name&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- Stop services&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker compose top&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp;--- Display the running processes&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker compose up&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;&amp;nbsp;--- create and start containers&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;u&gt;Docker-Compose Commands&lt;/u&gt;&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker-compose -v&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt; &amp;nbsp;--- Docker version&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker-compose --version&amp;nbsp; &lt;span style=&quot;color: #ffe599;&quot;&gt;&amp;nbsp;--- Docker version&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker-compose version&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- Docker version&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker-compose config&amp;nbsp; --- &lt;span style=&quot;color: #ffd966;&quot;&gt;validate docker file&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker-compose ps&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- displaying list of running docker-compose containers&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker-compose ps -a&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- displaying lift of all docker compose containers&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker compose ps&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- displaying lift of running docker compose containers&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker compose ps -a&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt; --- displaying lift of all docker compose containers&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffd966;&quot;&gt;docker-compose ps == docker-compose ps -a == docker compose ps -a&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker-compose ps || grep=test&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- filtering by container name&lt;/span&gt;&lt;/li&gt;&lt;li&gt;APP_PORT=80 docker-compose ps&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- setting variable in compose file&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker-compose ps service_name&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;---- list out specific service&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker-compose build&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- build container&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker-compose build service_name &lt;span style=&quot;color: #ffd966;&quot;&gt;--- build specific service container&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker-compose up &lt;span style=&quot;color: #ffd966;&quot;&gt;--- pulling and starting services containers from compose file&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker-compose -d up &lt;span style=&quot;color: #ffd966;&quot;&gt;--- detached mode&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker-compose -f compose_file_yml up&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- specifiying compose file name&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker-compose up --scale service_name=number_of_container&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;---adding scaling&lt;/span&gt;&lt;/li&gt;&lt;li&gt;APP_PORT=80 docker-compose up &lt;span style=&quot;color: #ffd966;&quot;&gt;--- setting variable in compose file&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker-compose up -d service_name &lt;span style=&quot;color: #ffd966;&quot;&gt;--- run specific service&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker-compose down &lt;span style=&quot;color: #ffd966;&quot;&gt;--- stopping and removing services containers from compose file&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker-compose -f compose_file_yml down&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- specifying compose file name&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker compose down service_name&lt;span style=&quot;color: #ffd966;&quot;&gt; --- stop and remove specific service&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker-compose stop&amp;nbsp; &lt;span style=&quot;color: #ffd966;&quot;&gt;--- stop docker compose containers&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker-compose rm&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt;--- remove stopped docker compose containers&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffd966;&quot;&gt;down = stop + rm&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffd966;&quot;&gt;up = pull + start&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker-compose exec service_name command &lt;span style=&quot;color: #ffd966;&quot;&gt;--- execute specific service and specific command&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;docker-compose log &lt;span style=&quot;color: #ffd966;&quot;&gt;--- display all logs created by docker-compose&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker-compose log service_name&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt; --- display logs specific service created by docker-compose&lt;/span&gt;&lt;/li&gt;&lt;li&gt;docker-compose log -f service_name&amp;nbsp;&lt;span style=&quot;color: #ffd966;&quot;&gt; --- display logs specific service created by docker-compose&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span style=&quot;color: #ffd966;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;h2 style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;u&gt;Dockerfile instruction arguments&lt;/u&gt;&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;FROM &lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;Sets the base image for subsequent&lt;/div&gt;&lt;div&gt;MAINTAINER&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Sets the author field of the generated images&lt;/div&gt;&lt;div&gt;RUN &lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;Execute commands in a new layer on top of the current image and commit the results&lt;/div&gt;&lt;div&gt;CMD &lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;Allowed only once (if many then last one takes effect)&lt;/div&gt;&lt;div&gt;LABEL &lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;Adds metadata to an image&lt;/div&gt;&lt;div&gt;EXPOSE &lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;Informs container runtime that the container listens on the specified network ports at runtime&lt;/div&gt;&lt;div&gt;ENV &lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;Sets an environment variable&lt;/div&gt;&lt;div&gt;ADD &lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;Copy new files, directories, or remote file URLs from into the filesystem of the container&lt;/div&gt;&lt;div&gt;COPY &lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;Copy new files or directories into the filesystem of the container&lt;/div&gt;&lt;div&gt;ENTRYPOINT &lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Allows you to configure a container that will run as an executable&lt;/div&gt;&lt;div&gt;VOLUME &lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;Creates a mount point and marks it as holding externally mounted volumes from native host or other containers&lt;/div&gt;&lt;div&gt;USER &lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;Sets the username or UID to use when running the image&lt;/div&gt;&lt;div&gt;WORKDIR &lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Sets the working directory for any RUN, CMD, ENTRYPOINT, COPY, and ADD commands&lt;/div&gt;&lt;div&gt;ARG &lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;Defines a variable that users can pass at build-time to the builder using --build-arg&lt;/div&gt;&lt;div&gt;ONBUILD &lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Adds an instruction to be executed later, when the image is used as the base for another build&lt;/div&gt;&lt;div&gt;STOPSIGNAL &lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Sets the system call signal that will be sent to the container to exit&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffd966;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/6790600192550032114/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2021/03/docker.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/6790600192550032114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/6790600192550032114'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2021/03/docker.html' title='Docker'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-4585245045762106833</id><published>2020-08-07T22:18:00.007+05:30</published><updated>2024-10-09T23:39:36.632+05:30</updated><title type='text'>Git Commands</title><content type='html'>&lt;p&gt;Basic&lt;/p&gt;&lt;table style=&quot;background-color: #0d1117; border-collapse: collapse; border-spacing: 0px; color: #c9d1d9; display: block; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 16px; margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--color-bg-primary); border-top: 1px solid var(--color-markdown-table-tr-border); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;git --version&lt;br /&gt;or&lt;br /&gt;git -v&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;check git installed version&lt;br /&gt;&lt;br /&gt;shortened&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&amp;nbsp;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Config&lt;/p&gt;&lt;table style=&quot;background-color: #0d1117; border-collapse: collapse; border-spacing: 0px; color: #c9d1d9; display: block; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 16px; margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--color-bg-primary); border-top: 1px solid var(--color-markdown-table-tr-border); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;git config user.name&lt;br /&gt;git config user.email&lt;br /&gt;git config --global user.name&lt;br /&gt;git config --global user.email&lt;br /&gt;git config user.name [UserName]&lt;br /&gt;git config user.email [EmailId]&lt;br /&gt;git config --global user.name [UserName]&lt;br /&gt;git config --global user.email [EmailId]&lt;br /&gt;git config --global --replace-all user.name Debashish&lt;br /&gt;&lt;br /&gt;git config pull.rebase false&lt;br /&gt;git config pull.rebase true&lt;br /&gt;git config pull.ff only&lt;br /&gt;git config --global alias.st status&lt;br /&gt;&lt;br /&gt;git config --global pull.rebase false&lt;br /&gt;git config --global pull.rebase true&lt;br /&gt;git config --global pull.ff only&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;display configured user name&lt;br /&gt;display configured user email&lt;br /&gt;display globally configured user name&lt;br /&gt;display globally configured user email&lt;br /&gt;set user name in config&lt;br /&gt;set user email in config&lt;br /&gt;set user name globally in config&lt;br /&gt;set user email globally in config&lt;br /&gt;eliminate error during adding global username&lt;br /&gt;&lt;br /&gt;merge (the default strategy)&lt;br /&gt;Rebase&lt;br /&gt;fast-forward only&lt;br /&gt;configure st as alias for status&lt;br /&gt;&lt;br /&gt;merge (the default strategy)&lt;br /&gt;rebase&lt;br /&gt;fast-forward only&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;p&gt;Create a new repository&lt;/p&gt;&lt;table style=&quot;background-color: #0d1117; border-collapse: collapse; border-spacing: 0px; color: #c9d1d9; display: block; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 16px; margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--color-bg-primary); border-top: 1px solid var(--color-markdown-table-tr-border); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;echo &quot;# Git_V1&quot; &amp;gt;&amp;gt; README.md&lt;br /&gt;git init&lt;br /&gt;git add README.md&lt;br /&gt;git commit -m &quot;first commit&quot;&lt;br /&gt;git branch -M master&lt;br /&gt;git remote add origin [SSH Path for RemoteRepositoryURL]&lt;br /&gt;git push -u origin master&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Create and write a file README.md with content &quot;# Git_V1&quot;&lt;br /&gt;initialize directory for git&lt;br /&gt;add mark down file with name README&lt;br /&gt;add commit message&lt;br /&gt;rename the current branch to &quot;master&lt;br /&gt;add remote repository using URL&lt;br /&gt;push changes to master&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;p&gt;Push an existing repository from local to remote&lt;/p&gt;&lt;table style=&quot;background-color: #0d1117; border-collapse: collapse; border-spacing: 0px; color: #c9d1d9; display: block; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 16px; margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--color-bg-primary); border-top: 1px solid var(--color-markdown-table-tr-border); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;git remote add origin [SSH Path for RemoteRepositoryURL]&lt;br /&gt;&lt;br /&gt;git branch -M master&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;git push -u origin master&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;br /&gt;add remote repository using URL&lt;br /&gt;&lt;br /&gt;rename the current branch to master&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;push your local master branch to a remote repository named origin and set it as the upstream branch&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;!--more--&gt;&lt;p&gt;Clone a remote repository to local&lt;/p&gt;&lt;table style=&quot;background-color: #0d1117; border-collapse: collapse; border-spacing: 0px; color: #c9d1d9; display: block; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 16px; margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--color-bg-primary); border-top: 1px solid var(--color-markdown-table-tr-border); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;git clone [SSH Path for RemoteRepositoryURL]&lt;br /&gt;&lt;br /&gt;git clone –branch [BranchName] [RepositoryURL]&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Clone a repository from remote to local machine&lt;br /&gt;&lt;br /&gt;Clones a specific branch from a repository&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;!--more--&gt;&lt;p&gt;Operations&lt;/p&gt;&lt;table style=&quot;background-color: #0d1117; border-collapse: collapse; border-spacing: 0px; color: #c9d1d9; display: block; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 16px; margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--color-bg-primary); border-top: 1px solid var(--color-markdown-table-tr-border); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;git init&lt;br /&gt;&lt;br /&gt;git init [Directory]&lt;br /&gt;&lt;br /&gt;git add [FileName]&lt;br /&gt;&lt;br /&gt;git add .&lt;br /&gt;&lt;br /&gt;git remote add origin [SSH Path for Remote Repo]&lt;br /&gt;&lt;br /&gt;git status&lt;br /&gt;&lt;br /&gt;git diff&lt;br /&gt;&lt;br /&gt;git diff --staged&lt;br /&gt;&lt;br /&gt;git commit -m &quot;[Message]&quot;&lt;br /&gt;&lt;br /&gt;git commit -a -m &quot;[Message]&quot;&lt;br /&gt;&lt;br /&gt;git mv [FileName] [New_FileName]&lt;br /&gt;&lt;br /&gt;git push -u origin master&lt;br /&gt;&lt;br /&gt;git push -d origin [BranchName]&lt;br /&gt;&lt;br /&gt;git pull origin master&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;initialize directory for git&lt;br /&gt;&lt;br /&gt;create a new git repository in the specified directory&lt;br /&gt;&lt;br /&gt;add given files to stage&lt;br /&gt;&lt;br /&gt;add all unchanged files to stage&lt;br /&gt;&lt;br /&gt;add repository to remote&lt;br /&gt;&lt;br /&gt;show status of changes (tracked and untracked)&lt;br /&gt;&lt;br /&gt;show difference between changes (modified vs unmodified)&lt;br /&gt;&lt;br /&gt;show difference between changes between staged and unstaged&lt;br /&gt;&lt;br /&gt;push changes to stage area&lt;br /&gt;&lt;br /&gt;push changes&lt;br /&gt;&lt;br /&gt;rename file&lt;br /&gt;&lt;br /&gt;push changes to master&lt;br /&gt;&lt;br /&gt;delete remote branch&lt;br /&gt;&lt;br /&gt;update local repo from remote master repo&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Undo/Delete&lt;/p&gt;&lt;table style=&quot;background-color: #0d1117; border-collapse: collapse; border-spacing: 0px; color: #c9d1d9; display: block; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 16px; margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--color-bg-primary); border-top: 1px solid var(--color-markdown-table-tr-border); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;git rm [FileName]&lt;br /&gt;&lt;br /&gt;git rm --cached [FileName]&lt;br /&gt;&lt;br /&gt;git restore --staged [FileName]&lt;br /&gt;&lt;br /&gt;git reset [FileName]&lt;br /&gt;&lt;br /&gt;git reset&lt;br /&gt;&lt;br /&gt;git revert [CommitId from above comman]&lt;br /&gt;&lt;br /&gt;rm -rf .git&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;remove file and commit in stage&lt;br /&gt;&lt;br /&gt;stop tracking file&lt;br /&gt;&lt;br /&gt;changes back from stage area&lt;br /&gt;&lt;br /&gt;addback given staged file to unstage&lt;br /&gt;&lt;br /&gt;addback all staged files to unstage&lt;br /&gt;&lt;br /&gt;create a new commit that undoes the changes made by a previous commit.&lt;br /&gt;&lt;br /&gt;Delete .git file from repository&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;!--more--&gt;&lt;p&gt;Branch&lt;/p&gt;&lt;table style=&quot;background-color: #0d1117; border-collapse: collapse; border-spacing: 0px; color: #c9d1d9; display: block; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 16px; margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--color-bg-primary); border-top: 1px solid var(--color-markdown-table-tr-border); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;git branch&lt;br /&gt;git branch [NewBranchName&lt;br /&gt;git branch --merged&lt;br /&gt;git branch --no-merged&lt;br /&gt;git checkout [ExistingBranchName]&lt;br /&gt;git checkout -b [NewBranchName]&lt;br /&gt;git checkout --[FileName]&lt;br /&gt;git checkout -f&lt;br /&gt;git switch -c [NewBranchName]&lt;br /&gt;&lt;br /&gt;git merge [BranchNameToMergeWithCurrentBranch]&lt;br /&gt;git branch -d [BranchName]&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;list out all branch&lt;br /&gt;create new branch&lt;br /&gt;already merged branches&lt;br /&gt;not merged branches&lt;br /&gt;switch to existing mentioned branch&lt;br /&gt;create new branch and switch to it&lt;br /&gt;revert to previous stage for that file&lt;br /&gt;revert to previous stage for all changes&lt;br /&gt;create new branch and switch to it&lt;br /&gt;&lt;br /&gt;Merge provided branch name to merge with current branch&lt;br /&gt;Delete Branch&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;!--more--&gt;&lt;p&gt;Stash&lt;/p&gt;&lt;table style=&quot;background-color: #0d1117; border-collapse: collapse; border-spacing: 0px; color: #c9d1d9; display: block; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 16px; margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--color-bg-primary); border-top: 1px solid var(--color-markdown-table-tr-border); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;git stash -u&lt;br /&gt;git stash list&lt;br /&gt;git stash pop&lt;br /&gt;git stash apply&lt;br /&gt;git stash drop&lt;br /&gt;git stash clear&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;temporarily save changes in your working directory, including untracked files&lt;br /&gt;displays a list of all the stashed changes in your repository&lt;br /&gt;&lt;br /&gt;apply the most recent stashed changes back to your working directory and then remove that stash from the stash list&lt;br /&gt;&lt;br /&gt;reapply changes that you previously stashed with git stash&lt;br /&gt;&lt;br /&gt;Drop the most recent stash&lt;br /&gt;&lt;br /&gt;remove all stash entries from your stash list. This is a way to clean up your stash when you no longer need any of the stashed changes.&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;!--more--&gt;&lt;p&gt;Log&lt;/p&gt;&lt;table style=&quot;background-color: #0d1117; border-collapse: collapse; border-spacing: 0px; color: #c9d1d9; display: block; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 16px; margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--color-bg-primary); border-top: 1px solid var(--color-markdown-table-tr-border); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;git log&lt;br /&gt;git log -p&lt;br /&gt;git log -2&lt;br /&gt;git log -p -2&lt;br /&gt;git log --stat&lt;br /&gt;git log --pretty=oneline&lt;br /&gt;git log --pretty=short&lt;br /&gt;git log --pretty=full&lt;br /&gt;git log --pretty=format:&quot;%h&amp;nbsp;&lt;br /&gt;git log --oneline &lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;view the commit history of a Git repository in reverse chronological order (most recent first).&lt;br /&gt;log with changed details&lt;br /&gt;last two log&lt;br /&gt;last two logs with changed details&lt;br /&gt;show changed status&amp;nbsp;&lt;br /&gt;show changes in one line and in shorter view&lt;br /&gt;show changes in short summary&lt;br /&gt;show changes in full detail&lt;br /&gt;log in pretty customized format (a-&amp;gt; author, e-&amp;gt; email)&lt;br /&gt;show changes in one line&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;!--more--&gt;&lt;p&gt;Log Pretty&lt;/p&gt;&lt;table style=&quot;background-color: #0d1117; border-collapse: collapse; border-spacing: 0px; color: #c9d1d9; display: block; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 16px; margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--color-bg-primary); border-top: 1px solid var(--color-markdown-table-tr-border); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;git log --pretty=format:&quot;%T -- %an&quot;&lt;br /&gt;git log --pretty=format:&quot;%H -- %an&quot;&lt;br /&gt;git log --pretty=format:&quot;%h -- %al&quot;&lt;br /&gt;git log --pretty=format:&quot;%h -- %ad&quot;&lt;br /&gt;git log --pretty=format:&quot;%h -- %ar&quot;&lt;br /&gt;git log --pretty=format:&quot;%h -- %at&quot;&lt;br /&gt;git log --pretty=format:&quot;%h -- %ai&quot;&lt;br /&gt;git log --pretty=format:&quot;%h -- %aI&quot;&lt;br /&gt;git log --pretty=format:&quot;%h -- %as&quot;&lt;br /&gt;git log --since=2.days&lt;br /&gt;git log --since=2.weeks&lt;br /&gt;git log --since=2.months&lt;br /&gt;git log --author=&quot;[AuthorName]&quot;&lt;br /&gt;git log --before=&quot;Fri Aug 7 21:07:21 2020&quot;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--color-markdown-table-border); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/4585245045762106833/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2020/08/git-commands.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/4585245045762106833'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/4585245045762106833'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2020/08/git-commands.html' title='Git Commands'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-1326528990123220506</id><published>2020-05-19T22:11:00.000+05:30</published><updated>2020-05-19T22:11:58.615+05:30</updated><title type='text'>JSON VS CSON VS XML VS YAML</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;&lt;u&gt;JSON (JavaScript Object Notation)&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;a&quot;: 1,&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;b&quot;: [ 1, 2, 3 ],&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;c&quot;: &quot;Hello&quot;,&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;d&quot;: true,&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;e&quot;: &quot;c&quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;CSON (CoffeeScript Object Notation)&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&quot;a&quot;: 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &quot;b&quot;:&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;-1&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;-2&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;-3&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &quot;c&quot;: &quot;Hello&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &quot;d&quot;: true&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &quot;e&quot;: &quot;c&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;XML (Extensible Markup Language)&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;a&amp;gt;1&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;b&amp;gt;1&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;b&amp;gt;2&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;b&amp;gt;3&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;c&amp;gt;Hello&amp;lt;/c&amp;gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;d&amp;gt;true&amp;lt;/d&amp;gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;e&amp;gt;c&amp;lt;/e&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;YAML (Human-Readable Data-Serialization Language)&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
a: 1&lt;br /&gt;
b:&lt;br /&gt;
&amp;nbsp; - 1&lt;br /&gt;
&amp;nbsp; - 2&lt;br /&gt;
&amp;nbsp; - 3&lt;br /&gt;
c: &quot;Hello&quot;&lt;br /&gt;
d: true&lt;br /&gt;
e: &#39;c&#39;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/1326528990123220506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2020/05/json-vs-cson-vs-xml-vs-yaml.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/1326528990123220506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/1326528990123220506'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2020/05/json-vs-cson-vs-xml-vs-yaml.html' title='JSON VS CSON VS XML VS YAML'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-2301878115578131741</id><published>2019-07-30T16:10:00.003+05:30</published><updated>2019-07-30T16:20:43.230+05:30</updated><title type='text'>Autofac</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: white; font-size: large;&quot;&gt;&lt;b style=&quot;background-color: #6fa8dc;&quot;&gt;Example:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #fcfcfc; box-sizing: border-box; color: #404040; font-family: Lato, proxima-nova, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 24px;&quot;&gt;
The basic pattern for integrating Autofac into your application is:&lt;/div&gt;
&lt;ul class=&quot;simple&quot; style=&quot;background-color: #fcfcfc; box-sizing: border-box; color: #404040; font-family: Lato, proxima-nova, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 16px; line-height: 24px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 24px; padding: 0px;&quot;&gt;
&lt;li style=&quot;box-sizing: border-box; list-style: disc; margin-left: 24px;&quot;&gt;Structure your app with&amp;nbsp;&lt;em style=&quot;box-sizing: border-box;&quot;&gt;inversion of control&lt;/em&gt;&amp;nbsp;(IoC) in mind.&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box; list-style: disc; margin-left: 24px;&quot;&gt;Add Autofac references.&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box; list-style: disc; margin-left: 24px;&quot;&gt;At application startup…&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box; list-style: disc; margin-left: 24px;&quot;&gt;Create a&amp;nbsp;&lt;cite style=&quot;box-sizing: border-box;&quot;&gt;ContainerBuilder&lt;/cite&gt;.&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box; list-style: disc; margin-left: 24px;&quot;&gt;Register components.&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box; list-style: disc; margin-left: 24px;&quot;&gt;Build the container and store it for later use.&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box; list-style: disc; margin-left: 24px;&quot;&gt;During application execution…&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box; list-style: disc; margin-left: 24px;&quot;&gt;Create a lifetime scope from the container.&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box; list-style: disc; margin-left: 24px;&quot;&gt;Use the lifetime scope to resolve instances of the components.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;lato&amp;quot; , , &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;color: white; font-family: &amp;quot;lato&amp;quot; , , &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;using Autofac;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;lato&amp;quot; , , &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;lato&amp;quot; , , &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;using System;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;lato&amp;quot; , , &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;lato&amp;quot; , , &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;lato&amp;quot; , , &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;
&lt;/span&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;lato&amp;quot; , , &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;namespace AutofacDemo&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;lato&amp;quot; , , &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; class Program&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private static IContainer Container { get; set; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ContainerBuilder builder = new ContainerBuilder();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; builder.RegisterType&amp;lt;Output&amp;gt;().As&amp;lt;IOutput&amp;gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; builder.RegisterType&amp;lt;DateWriter&amp;gt;().As&amp;lt;IDateWriter&amp;gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //New Date Class Register With Date Interface&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Override Date Writer method with New Date Writer Method&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; builder.RegisterType&amp;lt;NewDateWriter&amp;gt;().As&amp;lt;IDateWriter&amp;gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Container = builder.Build();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WriteDate();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.ReadLine();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private static void WriteDate()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using (var scope = Container.BeginLifetimeScope())&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var writer = scope.Resolve&amp;lt;IDateWriter&amp;gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; writer.WriteDate();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; public interface IOutput&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; void Write(string content);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; public class Output : IOutput&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void Write(string content)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(content);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; public interface IDateWriter&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; void WriteDate();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; public class DateWriter : IDateWriter&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private IOutput _output;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public DateWriter(IOutput output)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _output = output;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void WriteDate()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _output.Write(DateTime.Today.ToShortDateString());&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; public class NewDateWriter : IDateWriter&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private IOutput _output;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public NewDateWriter(IOutput output)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _output = output;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void WriteDate()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _output.Write(DateTime.Today.AddDays(1).ToShortDateString());&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #404040;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #404040;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: white; font-size: x-large;&quot;&gt;&lt;u&gt;Add Autofac Reference from Nuget&amp;nbsp;&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div style=&quot;color: #404040;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #404040; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguASgMkx9nRgAj5JxC1idNHxAlrljLL-3i33lw_YL7SkR3sVS44yjscSoNq8k_Iit3Ohfu2u24rj4tVilrLv0PClzecDT0wDpB1ITRutxWrZadZkdfk0A0M-k4Hqq_TiPK0ewh68Ig-vae/s1600/Autofac_Nuget.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;727&quot; data-original-width=&quot;659&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguASgMkx9nRgAj5JxC1idNHxAlrljLL-3i33lw_YL7SkR3sVS44yjscSoNq8k_Iit3Ohfu2u24rj4tVilrLv0PClzecDT0wDpB1ITRutxWrZadZkdfk0A0M-k4Hqq_TiPK0ewh68Ig-vae/s640/Autofac_Nuget.PNG&quot; width=&quot;579&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguASgMkx9nRgAj5JxC1idNHxAlrljLL-3i33lw_YL7SkR3sVS44yjscSoNq8k_Iit3Ohfu2u24rj4tVilrLv0PClzecDT0wDpB1ITRutxWrZadZkdfk0A0M-k4Hqq_TiPK0ewh68Ig-vae/s1600/Autofac_Nuget.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: white;&quot;&gt;Please find &lt;/span&gt;&lt;a href=&quot;https://github.com/ddevashish/AutofacDemo&quot; style=&quot;background-color: white;&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;code Repository here in GIT&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #404040; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #404040;&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #404040;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/2301878115578131741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2019/07/autofac.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/2301878115578131741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/2301878115578131741'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2019/07/autofac.html' title='Autofac'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguASgMkx9nRgAj5JxC1idNHxAlrljLL-3i33lw_YL7SkR3sVS44yjscSoNq8k_Iit3Ohfu2u24rj4tVilrLv0PClzecDT0wDpB1ITRutxWrZadZkdfk0A0M-k4Hqq_TiPK0ewh68Ig-vae/s72-c/Autofac_Nuget.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-4719359339992569048</id><published>2019-06-20T16:38:00.006+05:30</published><updated>2019-06-20T16:38:43.405+05:30</updated><title type='text'>Generics</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Generics allow us to design classes and methods decoupled from the data type.&lt;br /&gt;
Name Space: System.Collections.Generic&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Example: Generic Method&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
&lt;br /&gt;
namespace CSharpPracktice&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public class Generics&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public bool AreEqual&amp;lt;Type&amp;gt;(Type value1, Type value2)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return value1.Equals(value2);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public class GenericsCaller&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void Demo()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Generics generics = new Generics();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bool result = generics.AreEqual&amp;lt;string&amp;gt;(&quot;20&quot;, &quot;20&quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (result)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Equal&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Not Equal&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Example: Generic Class&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
&lt;br /&gt;
namespace CSharpPracktice&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public class Generics&amp;lt;Type&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public bool AreEqual(Type value1, Type value2)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return value1.Equals(value2);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public class GenericsCaller&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void Demo()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Generics&amp;lt;string&amp;gt; generics = new Generics&amp;lt;string&amp;gt;();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bool result = generics.AreEqual(&quot;20&quot;, &quot;20&quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (result)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Equal&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Not Equal&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/4719359339992569048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2019/06/generics.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/4719359339992569048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/4719359339992569048'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2019/06/generics.html' title='Generics'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-8770198126216645314</id><published>2019-06-14T11:49:00.002+05:30</published><updated>2019-06-14T11:49:16.144+05:30</updated><title type='text'>Publish Subscriber Pattern</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Publish Subscriber Pattern (Observer Design Pattern)&lt;/h2&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;The Publisher/Subscriber pattern is one of the variations of the Observer designer pattern &lt;/li&gt;
&lt;li&gt;A publisher publishes a message and there are one or more Subscribers who capture the published message.&lt;/li&gt;
&lt;li&gt;Publishers broadcast messages, with no knowledge of the subscribers.&lt;/li&gt;
&lt;li&gt;Subscribers ‘listen’ out for messages regarding topic/categories that they are interested in without any knowledge of who the publishers are.&lt;/li&gt;
&lt;li&gt;The event bus transfers the messages from the publishers to the subscribers.&lt;/li&gt;
&lt;li&gt;Each subscriber only receives a subset of the messages that have been sent by the publisher, they only receive the message topics or categories they have subscribed to.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Event Bus knows what topic each subscriber is subscribed to. The event bus will filter messages based on topic and send the messages to subscribers that are subscribed to the topic of the message. The publishers are responsible for defining the topics of their messages.&lt;br /&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1_wNoBeXYsLYWNRL_WJCEE9GMNoKU976o5DWwfYbNwlLAuPUjQ1i-9vZ8PKptvcC43cFjoUC0PMAN9L7ynlXuzo_4DV90BAeAjgv580ZZPD4DA-UZeN3Wn5Uz8xlviV635UzSU1W02PlR/s1600/PublishSubscriberPattern1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;348&quot; data-original-width=&quot;629&quot; height=&quot;177&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1_wNoBeXYsLYWNRL_WJCEE9GMNoKU976o5DWwfYbNwlLAuPUjQ1i-9vZ8PKptvcC43cFjoUC0PMAN9L7ynlXuzo_4DV90BAeAjgv580ZZPD4DA-UZeN3Wn5Uz8xlviV635UzSU1W02PlR/s320/PublishSubscriberPattern1.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
To understand this consider a real-life scenario where Mobile operators are sending messages to their customers.&lt;div&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim3-fw_kVjE-Ha744tacBBz-stolGMaY_sG_wA1eM6PC0p5akJ9_gQaLhwiYpXaQVITdF6KR3WgWjg-TdJOpIoNJILLykgsWhJn4DwvbD2DDOTR7jnVeAx2IEUbU19ze-CoTRDXaYNPolz/s1600/PublishSubscriberPattern2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;369&quot; data-original-width=&quot;483&quot; height=&quot;244&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim3-fw_kVjE-Ha744tacBBz-stolGMaY_sG_wA1eM6PC0p5akJ9_gQaLhwiYpXaQVITdF6KR3WgWjg-TdJOpIoNJILLykgsWhJn4DwvbD2DDOTR7jnVeAx2IEUbU19ze-CoTRDXaYNPolz/s320/PublishSubscriberPattern2.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/8770198126216645314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2019/06/publish-subscriber-pattern.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/8770198126216645314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/8770198126216645314'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2019/06/publish-subscriber-pattern.html' title='Publish Subscriber Pattern'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1_wNoBeXYsLYWNRL_WJCEE9GMNoKU976o5DWwfYbNwlLAuPUjQ1i-9vZ8PKptvcC43cFjoUC0PMAN9L7ynlXuzo_4DV90BAeAjgv580ZZPD4DA-UZeN3Wn5Uz8xlviV635UzSU1W02PlR/s72-c/PublishSubscriberPattern1.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-2500981390299431707</id><published>2019-06-13T16:45:00.002+05:30</published><updated>2019-06-13T17:48:19.700+05:30</updated><title type='text'>Callback</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Callback: (Opposite to synchronous process)&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Function that will be called when a process is done executing a specific task.&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Usage is usually in asynchronous logic.&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;b&gt;Example in simple term&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Synchronous Process:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Customer go to shopkeeper and order to customize a boot. Shopkeeper takes some time to customize it and rerun it back to the customer. Customer wait till the process and when customer get back the customized shoes it gifted to his neighbor. This complete process is the simple example of synchronous process as customer has to wait till the process of shoe customization not done by the shopkeeper.&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Asynchronous Process (Callback):&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Customer go to shopkeeper and order to customize a boot. Shopkeeper told to the customer that it will takes some time to customize it. Customer said that I do not want to wait for the process. Take your time and when process for customization will be done then please handover the shoes to my neighbor, I do not want to wait for the process to accomplished. Shopkeeper said OK sure. Customer go back. Shopkeeper customized the shoe which takes some time and once done shopkeeper handover the shoes to the neighbor. This process is the example of asynchronous process as customer do not have to wait till the process was executing and this is also example of callback as once process of customization has been done, shoes was handover to the neighbor by the shopkeeper, which was to be done by customer in the synchronized process.&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;u&gt;Example:&lt;/u&gt;&lt;/b&gt;&lt;/h4&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public class CallbackDemo1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public delegate void DelegateSumOfNumbers(int x);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void PrintSumOfNumbers(int num)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Sum of numbers is &quot; + num);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void Demo()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int num = 5;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DelegateSumOfNumbers callBackSum = new DelegateSumOfNumbers(PrintSumOfNumbers);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InnerClassForSum innerClassForSum = new InnerClassForSum(num, callBackSum);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; innerClassForSum.computeSum();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public class InnerClassForSum&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private int number;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private DelegateSumOfNumbers _callBackSum;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public InnerClassForSum(int num, DelegateSumOfNumbers callBackSum)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; number = num;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _callBackSum = callBackSum;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void computeSum()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int sum = 0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt;= number; i++)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sum += i;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _callBackSum(sum);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/2500981390299431707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2019/06/callback.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/2500981390299431707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/2500981390299431707'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2019/06/callback.html' title='Callback'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-4676658388660883413</id><published>2019-06-12T17:59:00.001+05:30</published><updated>2019-06-14T00:49:23.852+05:30</updated><title type='text'>Delegate</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;u&gt;Prerequisite:&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;b&gt;Type Safe:&lt;/b&gt; Can not move one data type to other data type. Type safety means preventing type errors. Type error happens when unknowingly developer assigns one data type to other causing bugs. In C# you can not assign one type value to another type value. C# is type safe, JavaScript is not type safe.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Conversion:&lt;/b&gt; Converts from one data type to other data type using the convert class. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Casting: &lt;/b&gt;Converts from one data type to other data type by defining the data type. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Implicit Casting: &lt;/b&gt;No need to define to cast from where to where. No data loss. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Explicit Casting:&lt;/b&gt; Need to define to cast from where to where. Data loss can happen.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Reference Type:&lt;/b&gt; Unlike value types, a reference type doesn&#39;t store its value directly. Instead, it stores the address where the value is being stored. In other words, a reference type contains a pointer to another memory location that holds the data.&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;b&gt;&lt;u&gt;Delegate:&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Type safe function pointer.&lt;/li&gt;
&lt;li&gt;Just like class and string, Delegate is also reference type.&lt;/li&gt;
&lt;li&gt;Representative for the communication between two parties.&lt;/li&gt;
&lt;li&gt;Real world use is to callback and do the data communication.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;u&gt;Example-1:&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&amp;nbsp;&lt;span style=&quot;color: white;&quot;&gt;public class DelegateDemo&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public delegate void DelegateName1();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public delegate int DelegateName2();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public delegate bool DelegateName3();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public delegate bool DelegateName4(int x);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void method1()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Method1 called.&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public int method2()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Method2 called.&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 0;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private bool method3()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Method3 called.&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private bool method4(int x)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Method4 called.&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void method5()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Method5 called.&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void Demo()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // calling methods directly&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; method1();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; method2();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; method3();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; method5();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // calling methods using reference i.e. delegate&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Calling from delegate&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DelegateName1 delegateName1 = new DelegateName1(method1);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; delegateName1();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; delegateName1.Invoke();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; delegateName1 += method5;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; delegateName1();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DelegateName2 delegateName2 = new DelegateName2(method2);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DelegateName3 delegateName3 = new DelegateName3(method3);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DelegateName4 delegateName4 = new DelegateName4(method4);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; delegateName2();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; delegateName3();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; delegateName4(0);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;u&gt;Output:&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5VRmnjCOcxTzSi9HxwoHtNdksyUqVLN16x2rDReclORvD13eruzuQWQuQ4X77gsD3NcPX4YlG_B7o2-F_UYx3y4FEF5Nm-zVVXJlIWA0YCU7iUGZwoEgCrxOKHGIoeTbwfeNQdgUEku2m/s1600/OutPutDelegate.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;199&quot; data-original-width=&quot;181&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5VRmnjCOcxTzSi9HxwoHtNdksyUqVLN16x2rDReclORvD13eruzuQWQuQ4X77gsD3NcPX4YlG_B7o2-F_UYx3y4FEF5Nm-zVVXJlIWA0YCU7iUGZwoEgCrxOKHGIoeTbwfeNQdgUEku2m/s1600/OutPutDelegate.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #222222; font-family: arial, sans-serif;&quot;&gt;&lt;u&gt;Example-2:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Business Class&lt;br /&gt;&lt;br /&gt;
public class DelegateDemoBusinessClass&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public delegate void DelGetCalculatedValue(int x, int y);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private int _x, _y;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private DelGetCalculatedValue _delegateObject;// = new DelGetCalculatedValue(getCalculatedValue);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public DelegateDemoBusinessClass(int x, int y, DelGetCalculatedValue getCalculatedValue)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _x = x;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _y = y;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _delegateObject = this.getCalculatedValue;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void getCalculatedValue(int x, int y)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _delegateObject(x, y);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
User (Caller) Class&lt;br /&gt;&lt;br /&gt;
public class DelegateDemoCallerClass&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; enum typeOperation { Addition = 0, Substraction = 1, Multiplication = 2, Division = 3 };&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static void Demo()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int x = 20, y = 10, operationChoice = 3;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DelegateDemoBusinessClass.DelGetCalculatedValue getCalculated;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (operationChoice == Convert.ToInt32(typeOperation.Addition))&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getCalculated = myAdd;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else if (operationChoice == Convert.ToInt32(typeOperation.Substraction))&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getCalculated = mySub;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else if (operationChoice == Convert.ToInt32(typeOperation.Multiplication))&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getCalculated = myMul;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getCalculated = myDiv;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DelegateDemoBusinessClass demobusinessclass = new DelegateDemoBusinessClass(x, y, getCalculated);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getCalculated(x, y);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static void myAdd(int x, int y)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(x + y);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static void mySub(int x, int y)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(x - y);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static void myMul(int x, int y)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(x * y);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static void myDiv(int x, int y)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(x / y);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;    Multicast Delegate:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;That has references to more than one function.&lt;/li&gt;
&lt;li&gt;Two approaches to create multicast delegate.&lt;/li&gt;
&lt;li&gt;+ or += to register a method with the delegate&lt;/li&gt;
&lt;li&gt;- or -= to un-register a method with the delete&lt;/li&gt;
&lt;li&gt;Invokes the methods in the invocation list, the the same order in which they are added.&lt;/li&gt;
&lt;li&gt;If the delegate has a return type other than void and if the delegate is a multicast delegate, only the value of the last invoked method will be returned.&lt;/li&gt;
&lt;li&gt;If the delegate has an out parameter, the value of the output parameter, will be the value assigned by the last method.&lt;/li&gt;
&lt;li&gt;Usage: Observer design pattern.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 28px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/4676658388660883413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2019/06/delegate.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/4676658388660883413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/4676658388660883413'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2019/06/delegate.html' title='Delegate'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5VRmnjCOcxTzSi9HxwoHtNdksyUqVLN16x2rDReclORvD13eruzuQWQuQ4X77gsD3NcPX4YlG_B7o2-F_UYx3y4FEF5Nm-zVVXJlIWA0YCU7iUGZwoEgCrxOKHGIoeTbwfeNQdgUEku2m/s72-c/OutPutDelegate.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-6792707408091223091</id><published>2019-02-11T08:53:00.002+05:30</published><updated>2019-02-11T08:53:22.528+05:30</updated><title type='text'>JavaScript</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;&lt;u&gt;Window Popup&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
alert(&quot;Hello! I am an alert box!&quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Get Element By ID&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
document.getElementById(&#39;demo&#39;)// demo is the id of element&lt;br /&gt;
&lt;i&gt;// Assign some value&lt;/i&gt;&lt;br /&gt;
document.getElementById(&#39;demo&#39;).innerHTML = Date();&lt;br /&gt;
document.getElementById(&#39;demo1&#39;).innerHTML = &#39;Magic&#39;&lt;br /&gt;
&lt;i&gt;// Change Font Size&lt;/i&gt;&lt;br /&gt;
document.getElementById(&#39;demo2&#39;).style.fontSize=&#39;35px&#39;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Stop execution of debugging at certain point&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
debugger;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Hide&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
document.getElementById(&#39;demo1&#39;).style.display = &#39;none&#39;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Display&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
document.getElementById(&#39;demo1&#39;).style.display = &#39;block&#39;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Write in various form&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
document.write(&quot;This is document.write&quot;);&lt;br /&gt;
document.write(&quot;&amp;lt;br&amp;gt;&quot;);&lt;br /&gt;
document.write(10 * 5);&lt;br /&gt;
window.alert(&quot;This is window.alert&quot;);&lt;br /&gt;
console.log(&quot;this message is coming from console.log&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Function&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;//Accessing a function without () will return the function definition instead of the function result:&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
function toCelsius(fahrenheit) {&lt;br /&gt;
&amp;nbsp; return (5/9) * (fahrenheit-32);&lt;br /&gt;
}&lt;br /&gt;
document.getElementById(&quot;demo&quot;).innerHTML = toCelsius;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Calling function&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;input type=&quot;button&quot; value=&quot;button1&quot; onClick=&quot;myFunction()&quot;/&amp;gt;&lt;br /&gt;
var text = &quot;The temperature is &quot; + toCelsius(77) + &quot; Celsius&quot;;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Object&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
var car = {type:&quot;Fiat&quot;, model:&quot;500&quot;, color:&quot;white&quot;};&lt;br /&gt;
&lt;br /&gt;
var person = {&lt;br /&gt;
&amp;nbsp; firstName: &quot;John&quot;,&lt;br /&gt;
&amp;nbsp; lastName: &quot;Doe&quot;,&lt;br /&gt;
&amp;nbsp; age: 50,&lt;br /&gt;
&amp;nbsp; eyeColor: &quot;blue&quot;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;//The name:values pairs in JavaScript objects are called properties:&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Accessing Object Properties&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
objectName.propertyName&lt;br /&gt;
//or&lt;br /&gt;
objectName[&quot;propertyName&quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Variable Declaration&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
// Simple string&lt;br /&gt;
var car = &quot;Fiat&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;The this Keyword&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In a function definition, this refers to the &quot;owner&quot; of the function.&lt;br /&gt;
In other words, this.firstName means the firstName property of this object.&lt;br /&gt;
&lt;br /&gt;
fullName : function() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; return this.firstName + &quot; &quot; + this.lastName;&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;lt;button onclick=&quot;this.innerHTML = Date()&quot;&amp;gt;The time is?&amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;i&gt;//A method is a function stored as a property.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
var person = {&lt;br /&gt;
&amp;nbsp; firstName: &quot;John&quot;,&lt;br /&gt;
&amp;nbsp; lastName : &quot;Doe&quot;,&lt;br /&gt;
&amp;nbsp; id&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: 5566,&lt;br /&gt;
&amp;nbsp; fullName : function() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; return this.firstName + &quot; &quot; + this.lastName;&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;String Operations&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Length&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
txt.length;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Escape character&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The backslash (\) escape character turns special characters into string characters&lt;br /&gt;
var x = &quot;We are the so-called \&quot;Vikings\&quot; from the north.&quot;;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;More&lt;/i&gt;&lt;br /&gt;
\b&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Backspace&lt;br /&gt;
\f&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Form Feed&lt;br /&gt;
\n&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;New Line&lt;br /&gt;
\r&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Carriage Return&lt;br /&gt;
\t&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Horizontal Tabulator&lt;br /&gt;
\v&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Vertical Tabulator&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Break Line string&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
var txt = &quot;Hello \&lt;br /&gt;
Dolly!&quot;;&lt;br /&gt;
&lt;br /&gt;
var txt = &quot;Hello &quot; +&lt;br /&gt;
&quot;Dolly!&quot;;&lt;br /&gt;
&lt;br /&gt;
var x = &quot;John&quot;;&lt;br /&gt;
var y = new String(&quot;John&quot;);&lt;br /&gt;
&lt;br /&gt;
// typeof x will return string&lt;br /&gt;
// typeof y will return object&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;Don&#39;t create strings as objects. It slows down execution speed.&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;String Index&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
str.indexOf(&quot;locate&quot;);&lt;br /&gt;
str.lastIndexOf(&quot;locate&quot;);&lt;br /&gt;
&lt;br /&gt;
Both indexOf(), and lastIndexOf() return -1 if the text is not found.&lt;br /&gt;
Both methods accept a second parameter as the starting position for the search:&lt;br /&gt;
&lt;br /&gt;
str.indexOf(&quot;locate&quot;, 15);&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;String Search&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The search() method searches a string for a specified value and returns the position of the match:&lt;br /&gt;
str.search(&quot;locate&quot;);&lt;br /&gt;
&lt;br /&gt;
The search() method cannot take a second start position argument.&lt;br /&gt;
The indexOf() method cannot take powerful search values (regular expressions).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;String other operations&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
slice(start, end)&lt;br /&gt;
substring(start, end)&lt;br /&gt;
substr(start, length)&lt;br /&gt;
substring() is similar to slice().&lt;br /&gt;
&lt;br /&gt;
The difference is that substring() cannot accept negative indexes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var str = &quot;Apple, Banana, Kiwi&quot;;&lt;br /&gt;
var res = str.slice(-12)&lt;br /&gt;
document.getElementById(&quot;demo&quot;).innerHTML = res;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;output:&lt;/b&gt;&lt;br /&gt;
Banana, Kiwi&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var str = &quot;Apple, Banana, Kiwi&quot;;&lt;br /&gt;
var res = str.slice(7);&lt;br /&gt;
document.getElementById(&quot;demo&quot;).innerHTML = res;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;output:&lt;/b&gt;&lt;br /&gt;
Banana, Kiwi&lt;br /&gt;
&lt;br /&gt;
var x = 100 / &quot;Apple&quot;;&lt;br /&gt;
isNaN(x);&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Output:&lt;/b&gt;&lt;br /&gt;
true&lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;String Equal&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
When using the == operator, equal strings are equal:&lt;br /&gt;
&lt;br /&gt;
When using the === operator, equal strings are not equal, because the === operator expects equality in both type and value.&lt;br /&gt;
&lt;br /&gt;
var x = 500;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
var y = new Number(500);&lt;br /&gt;
// (x == y) is true because x and y have equal values&lt;br /&gt;
// (x === y) is false because x and y have different types&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;toFixed()&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
returns a string, with the number written with a specified number of decimals:&lt;br /&gt;
&lt;br /&gt;
var x = 9.656;&lt;br /&gt;
x.toFixed(0);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// returns 10&lt;br /&gt;
x.toFixed(2);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// returns 9.66&lt;br /&gt;
x.toFixed(4);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// returns 9.6560&lt;br /&gt;
x.toFixed(6);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// returns 9.656000&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;toPrecision()&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
returns a string, with a number written with a specified length:&lt;br /&gt;
&lt;br /&gt;
var x = 9.656;&lt;br /&gt;
x.toPrecision();&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // returns 9.656&lt;br /&gt;
x.toPrecision(2);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// returns 9.7&lt;br /&gt;
x.toPrecision(4);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// returns 9.656&lt;br /&gt;
x.toPrecision(6);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// returns 9.65600&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;valueOf()&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
returns a number as a number.&lt;br /&gt;
&lt;br /&gt;
var x = 123;&lt;br /&gt;
x.valueOf();&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // returns 123 from variable x&lt;br /&gt;
(123).valueOf();&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // returns 123 from literal 123&lt;br /&gt;
(100 + 23).valueOf();&amp;nbsp; &amp;nbsp;// returns 123 from expression 100 + 23&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Array&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
var cars = [&quot;Saab&quot;, &quot;Volvo&quot;, &quot;BMW&quot;];&lt;br /&gt;
&lt;br /&gt;
var cars = [&lt;br /&gt;
&amp;nbsp; &quot;Saab&quot;,&lt;br /&gt;
&amp;nbsp; &quot;Volvo&quot;,&lt;br /&gt;
&amp;nbsp; &quot;BMW&quot;&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
var cars = new Array(&quot;Saab&quot;, &quot;Volvo&quot;, &quot;BMW&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Array Vs Object&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
Arrays use numbers to access its &quot;elements&quot;. In this example, person[0] returns John&lt;br /&gt;
var person = [&quot;John&quot;, &quot;Doe&quot;, 46];&lt;br /&gt;
&lt;br /&gt;
Objects use names to access its &quot;members&quot;. In this example, person.firstName returns John&lt;br /&gt;
var person = {firstName:&quot;John&quot;, lastName:&quot;Doe&quot;, age:46};&lt;br /&gt;
&lt;br /&gt;
In JavaScript, arrays use numbered indexes.&amp;nbsp;&lt;br /&gt;
In JavaScript, objects use named indexes.&lt;br /&gt;
&lt;br /&gt;
var fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
fruits.length;&amp;nbsp; &amp;nbsp;// the length of fruits is 4&lt;br /&gt;
&lt;br /&gt;
fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
var first = fruits[0];//Accessing the First Array Element&lt;br /&gt;
var last = fruits[fruits.length - 1];//Accessing the Last Array Element&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Looping Array Elements&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
var fruits, text, fLen, i;&lt;br /&gt;
fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
fLen = fruits.length;&lt;br /&gt;
&lt;br /&gt;
text = &quot;&amp;lt;ul&amp;gt;&quot;;&lt;br /&gt;
for (i = 0; i &amp;lt; fLen; i++) {&lt;br /&gt;
&amp;nbsp; text += &quot;&amp;lt;li&amp;gt;&quot; + fruits[i] + &quot;&amp;lt;/li&amp;gt;&quot;;&lt;br /&gt;
}&lt;br /&gt;
text += &quot;&amp;lt;/ul&amp;gt;&quot;;&lt;br /&gt;
&lt;br /&gt;
var fruits, text;&lt;br /&gt;
fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
&lt;br /&gt;
text = &quot;&amp;lt;ul&amp;gt;&quot;;&lt;br /&gt;
fruits.forEach(myFunction);&lt;br /&gt;
text += &quot;&amp;lt;/ul&amp;gt;&quot;;&lt;br /&gt;
&lt;br /&gt;
function myFunction(value) {&lt;br /&gt;
&amp;nbsp; text += &quot;&amp;lt;li&amp;gt;&quot; + value + &quot;&amp;lt;/li&amp;gt;&quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
var fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
fruits.push(&quot;Lemon&quot;);&amp;nbsp; &amp;nbsp; // adds a new element (Lemon) to fruits&lt;br /&gt;
&lt;br /&gt;
JavaScript does not support arrays with named indexes.&lt;br /&gt;
In JavaScript, arrays always use numbered indexes.&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
var fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
document.getElementById(&quot;demo&quot;).innerHTML = fruits.toString();&lt;br /&gt;
document.getElementById(&quot;demo1&quot;).innerHTML = fruits.join(&quot; * &quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;output:&lt;/b&gt;&lt;br /&gt;
Banana,Orange,Apple,Mango&lt;br /&gt;
Banana * Orange * Apple * Mango&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;The pop, push, shift, unshift&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
method removes the last element from an array:&lt;br /&gt;
var fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
fruits.pop();&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Removes the last element (&quot;Mango&quot;) from fruits&lt;br /&gt;
&lt;br /&gt;
var fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
var x = fruits.pop();&amp;nbsp; &amp;nbsp; &amp;nbsp; // the value of x is &quot;Mango&quot;&lt;br /&gt;
&lt;br /&gt;
var fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
fruits.push(&quot;Kiwi&quot;);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//&amp;nbsp; Adds a new element (&quot;Kiwi&quot;) to fruits&lt;br /&gt;
&lt;br /&gt;
var fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
var x = fruits.push(&quot;Kiwi&quot;);&amp;nbsp; &amp;nbsp;//&amp;nbsp; the value of x is 5&lt;br /&gt;
&lt;br /&gt;
The shift() method removes the first array element and &quot;shifts&quot; all other elements to a lower index.&lt;br /&gt;
var fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
fruits.shift();&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Removes the first element &quot;Banana&quot; from fruits&lt;br /&gt;
&lt;br /&gt;
var fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
var x = fruits.shift();&amp;nbsp; &amp;nbsp; // the value of x is &quot;Banana&quot;&lt;br /&gt;
&lt;br /&gt;
The unshift() method adds a new element to an array (at the beginning), and &quot;unshifts&quot; older elements:&lt;br /&gt;
&lt;br /&gt;
var fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
fruits.unshift(&quot;Lemon&quot;);&amp;nbsp; &amp;nbsp; // Adds a new element &quot;Lemon&quot; to fruits&lt;br /&gt;
&lt;br /&gt;
var fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
fruits.unshift(&quot;Lemon&quot;);&amp;nbsp; &amp;nbsp; // Returns 5&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The length property provides an easy way to append a new element to an array:&lt;br /&gt;
&lt;br /&gt;
var fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
fruits[fruits.length] = &quot;Kiwi&quot;;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Appends &quot;Kiwi&quot; to fruits&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since JavaScript arrays are objects, elements can be deleted by using the JavaScript operator delete:&lt;br /&gt;
&lt;br /&gt;
var fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
delete fruits[0];&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Changes the first element in fruits to undefined&lt;br /&gt;
&lt;br /&gt;
Using delete may leave undefined holes in the array. Use pop() or shift() instead.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;The splice()&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
method can be used to add new items to an array:&lt;br /&gt;
&lt;br /&gt;
var fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
fruits.splice(2, 0, &quot;Lemon&quot;, &quot;Kiwi&quot;);&lt;br /&gt;
&lt;br /&gt;
The first parameter (2) defines the position where new elements should be added (spliced in).&lt;br /&gt;
The second parameter (0) defines how many elements should be removed.&lt;br /&gt;
The rest of the parameters (&quot;Lemon&quot; , &quot;Kiwi&quot;) define the new elements to be added.&lt;br /&gt;
The splice() method returns an array with the deleted items:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;String concat&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
var myGirls = [&quot;Cecilie&quot;, &quot;Lone&quot;];&lt;br /&gt;
var myBoys = [&quot;Emil&quot;, &quot;Tobias&quot;, &quot;Linus&quot;];&lt;br /&gt;
var myChildren = myGirls.concat(myBoys);&amp;nbsp; &amp;nbsp;// Concatenates (joins) myGirls and myBoys&lt;br /&gt;
&lt;br /&gt;
var arr1 = [&quot;Cecilie&quot;, &quot;Lone&quot;];&lt;br /&gt;
var arr2 = [&quot;Emil&quot;, &quot;Tobias&quot;, &quot;Linus&quot;];&lt;br /&gt;
var arr3 = [&quot;Robin&quot;, &quot;Morgan&quot;];&lt;br /&gt;
var myChildren = arr1.concat(arr2, arr3);&amp;nbsp; &amp;nbsp;// Concatenates arr1 with arr2 and arr3&lt;br /&gt;
&lt;br /&gt;
var arr1 = [&quot;Cecilie&quot;, &quot;Lone&quot;];&lt;br /&gt;
var myChildren = arr1.concat([&quot;Emil&quot;, &quot;Tobias&quot;, &quot;Linus&quot;]);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;The slice, sort, referese()&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
method slices out a piece of an array into a new array.&lt;br /&gt;
This example slices out a part of an array starting from array element 1 (&quot;Orange&quot;):&lt;br /&gt;
&lt;br /&gt;
var fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Lemon&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
var citrus = fruits.slice(1);&lt;br /&gt;
&lt;br /&gt;
var fruits = [&quot;Banana&quot;, &quot;Orange&quot;, &quot;Apple&quot;, &quot;Mango&quot;];&lt;br /&gt;
fruits.sort();&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // First sort the elements of fruits&lt;br /&gt;
fruits.reverse();&amp;nbsp; &amp;nbsp; &amp;nbsp;// Then reverse the order of the elements&lt;br /&gt;
&lt;br /&gt;
var points = [40, 100, 1, 5, 25, 10];&lt;br /&gt;
&lt;br /&gt;
points.sort(function(a, b){return a - b}); //Ascending&lt;br /&gt;
points.sort(function(a, b){return a - b}); //Descending&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/6792707408091223091/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2019/02/javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/6792707408091223091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/6792707408091223091'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2019/02/javascript.html' title='JavaScript'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-4074506592204226737</id><published>2019-01-26T11:50:00.000+05:30</published><updated>2019-06-25T11:51:27.753+05:30</updated><title type='text'>Static</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;u&gt;&lt;b&gt;Static &lt;/b&gt;&lt;/u&gt;keyword has different role in different places for C#. When we declare static that means only single copy will be generate.&lt;br /&gt;
&lt;br /&gt;
Static container can only contains static members&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHWN3qk6v3PCrN4j4mKzyDJ9OixV53_LhuA__mmONieCEd-P3RzUEYdkWs7GUeLVRyx4lViTahFxtdjgFNDUmiEUsDIE3PkfhkAcI-bkaL-p8PqLi0chVQUziiAsZNSHR8sE_i9H0SKOrm/s1600/StaticContainer.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;228&quot; data-original-width=&quot;423&quot; height=&quot;172&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHWN3qk6v3PCrN4j4mKzyDJ9OixV53_LhuA__mmONieCEd-P3RzUEYdkWs7GUeLVRyx4lViTahFxtdjgFNDUmiEUsDIE3PkfhkAcI-bkaL-p8PqLi0chVQUziiAsZNSHR8sE_i9H0SKOrm/s320/StaticContainer.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
It is used in below places-&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Class&lt;/li&gt;
&lt;li&gt;Method&lt;/li&gt;
&lt;li&gt;Field&lt;/li&gt;
&lt;li&gt;Properties&lt;/li&gt;
&lt;li&gt;Constructor&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Static Class&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Only contain all static members like static methods, static&amp;nbsp;fields, static&amp;nbsp;properties and static&amp;nbsp;constructor.&lt;/li&gt;
&lt;li&gt;Any instance or non-static member can not be there in the Static Class.&lt;/li&gt;
&lt;li&gt;If we need to create all the members as static then we can create static class.&lt;/li&gt;
&lt;li&gt;Can not create instance of such class.&lt;/li&gt;
&lt;li&gt;Sealed.&lt;/li&gt;
&lt;li&gt;Cannot contain Instance Constructors&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3UBa0i_nFJzgrbmtL7awMFy5w5BP_KKciNvATr_xizJiz7mY6mC6RUCpinRG0NJpA4r_Fwh82Ngn5B-XOecdYt1llWqQjKWJizBBewzQfmYSR1cdNqEAmjU2pvSTsvL6Wo6PoUyKlqqXc/s1600/StaticClass.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;468&quot; data-original-width=&quot;475&quot; height=&quot;315&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3UBa0i_nFJzgrbmtL7awMFy5w5BP_KKciNvATr_xizJiz7mY6mC6RUCpinRG0NJpA4r_Fwh82Ngn5B-XOecdYt1llWqQjKWJizBBewzQfmYSR1cdNqEAmjU2pvSTsvL6Wo6PoUyKlqqXc/s320/StaticClass.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkr5NRuTRA08gJyYWyEXHlwPHWvJf7b9juPDHqa3expQskNfMIA__HWl9k-BAOgh_RU7y8kQ2k9H5S0uGDvc_acS96DvKVK0mSaRFie9UqIVneVKF8zbV8f_uwLgPUhiyXmTSd9AgjEID4/s1600/Non-StaticClass.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;510&quot; data-original-width=&quot;545&quot; height=&quot;299&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkr5NRuTRA08gJyYWyEXHlwPHWvJf7b9juPDHqa3expQskNfMIA__HWl9k-BAOgh_RU7y8kQ2k9H5S0uGDvc_acS96DvKVK0mSaRFie9UqIVneVKF8zbV8f_uwLgPUhiyXmTSd9AgjEID4/s320/Non-StaticClass.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3UBa0i_nFJzgrbmtL7awMFy5w5BP_KKciNvATr_xizJiz7mY6mC6RUCpinRG0NJpA4r_Fwh82Ngn5B-XOecdYt1llWqQjKWJizBBewzQfmYSR1cdNqEAmjU2pvSTsvL6Wo6PoUyKlqqXc/s1600/StaticClass.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkr5NRuTRA08gJyYWyEXHlwPHWvJf7b9juPDHqa3expQskNfMIA__HWl9k-BAOgh_RU7y8kQ2k9H5S0uGDvc_acS96DvKVK0mSaRFie9UqIVneVKF8zbV8f_uwLgPUhiyXmTSd9AgjEID4/s1600/Non-StaticClass.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;u&gt;Static Methods&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Only contain all static fields&lt;/li&gt;
&lt;li&gt;Non-static fields are not allowed in static methods&lt;/li&gt;
&lt;li&gt;Method can be access using class only, no instance is needed or can access.&lt;/li&gt;
&lt;li&gt;Single copy of static method will be shared among all the instances.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvkB0HNC4kMHR2ybnp-GNev97uxUVRjSuW9A6gANwMfa-27UzTFYBq6SMiq5d9v89VAFnP3nhdUUopeSUsUmLFsE31t92edCy03yytVOsVQYQG6Cz_zbnbqkGY19R9S6QipQgM5YKqboG9/s1600/Non-StaticMethod.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;244&quot; data-original-width=&quot;495&quot; height=&quot;157&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvkB0HNC4kMHR2ybnp-GNev97uxUVRjSuW9A6gANwMfa-27UzTFYBq6SMiq5d9v89VAFnP3nhdUUopeSUsUmLFsE31t92edCy03yytVOsVQYQG6Cz_zbnbqkGY19R9S6QipQgM5YKqboG9/s320/Non-StaticMethod.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Static Fields&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Single copy of fields/variables get created and shared among all the instances.&lt;/li&gt;
&lt;li&gt;If static variable value has been change using one instance then all other instance will get that changed value.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;u&gt;Static Property&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Can be access using class only.&lt;/li&gt;
&lt;li&gt;Using instance it can not be access.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Static Constructor&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Access modifier are not allowed.&lt;/li&gt;
&lt;li&gt;Static Constructor as it(class constructor) execute prior to any other constructor (instance constructor).&lt;/li&gt;
&lt;li&gt;Can instantiate value of static fields only.&lt;/li&gt;
&lt;li&gt;Non-Static fields is not allowed within the scope.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikNDScj9BZRSwNu-f8cDwOU52bYo5LaK-ijBqJLSNbS5g3ZvAvijMTUsOBi4urqCuuhlyG5yOVh2JlwkngJgY-P2Ll3xXeDpoFbtvDYF8yuw5C-FRLPQgw5RcdVNwmfGeBrU674xkDmiJ6/s1600/ExecutionOrder.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;210&quot; data-original-width=&quot;592&quot; height=&quot;113&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikNDScj9BZRSwNu-f8cDwOU52bYo5LaK-ijBqJLSNbS5g3ZvAvijMTUsOBi4urqCuuhlyG5yOVh2JlwkngJgY-P2Ll3xXeDpoFbtvDYF8yuw5C-FRLPQgw5RcdVNwmfGeBrU674xkDmiJ6/s320/ExecutionOrder.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;More About Static:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Static methods are not allowed in the interface.&lt;/li&gt;
&lt;li&gt;Access modifiers are not allowed in the interface and static constructor.&lt;/li&gt;
&lt;li&gt;Static class can&#39;t be inherit from interface/class/static class.&lt;/li&gt;
&lt;li&gt;Static class can only be inherit from object. ??&lt;/li&gt;
&lt;li&gt;Inheritance from static class in not possible as static classes are sealed.&lt;/li&gt;
&lt;li&gt;Inherited Static method can not be marked as override, virtual or abstract.&lt;/li&gt;
&lt;li&gt;Inherited Static methods can be marked as new.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/4074506592204226737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2019/01/static.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/4074506592204226737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/4074506592204226737'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2019/01/static.html' title='Static'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHWN3qk6v3PCrN4j4mKzyDJ9OixV53_LhuA__mmONieCEd-P3RzUEYdkWs7GUeLVRyx4lViTahFxtdjgFNDUmiEUsDIE3PkfhkAcI-bkaL-p8PqLi0chVQUziiAsZNSHR8sE_i9H0SKOrm/s72-c/StaticContainer.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-1309751627529351666</id><published>2019-01-11T17:55:00.002+05:30</published><updated>2019-01-14T17:34:45.558+05:30</updated><title type='text'>Structured/Imperative/Functional/Procedural Programming</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Structured Programming&amp;nbsp;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Top-down analysis&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Problem broken down into small piece (sub-problems) where each one has some significance.&lt;/li&gt;
&lt;li&gt;Each small piece of problems are individually solved and steps are clearly stated.&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Modular Programming&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Code is broke down into small groups of instructions&lt;/li&gt;
&lt;li&gt;These groups are knows as modules or subprograms or subroutines or methods.&lt;/li&gt;
&lt;li&gt;Avoid jumps (unconditional GoTo) as non-traceable&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Structured Code&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Divide modules into further small units of code&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Follow Top Down design model&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Maintainable Code&lt;/li&gt;
&lt;li&gt;Systematic Organization&lt;/li&gt;
&lt;li&gt;Reusable code block&lt;/li&gt;
&lt;li&gt;Subdivision of program into functions&lt;/li&gt;
&lt;li&gt;Hierarchy of task&lt;/li&gt;
&lt;li&gt;Simple and easy to understand the code&lt;/li&gt;
&lt;li&gt;Avoid unconditional Goto&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;&lt;u&gt;Un-Structured&amp;nbsp;code&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Unconditional Goto&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Imperative languages&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Imperative programming is a paradigm of computer programming in which the program describes a sequence of steps that change the state of the computer.&lt;/li&gt;
&lt;li&gt;Unlike declarative programming, which describes &quot;what&quot; a program should accomplish, imperative programming explicitly tells the computer &quot;how&quot; to accomplish it.&lt;/li&gt;
&lt;li&gt;To make programs simpler for a human to read and write, imperative statements can be grouped into sections known as code blocks.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Functional Programming&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Functional programming (FP) is about passing data from function to function to get a result.&lt;/li&gt;
&lt;li&gt;In FP, functions are treated as data, meaning you can use them as parameters, return them, build functions from other functions, and build custom functions.&lt;/li&gt;
&lt;li&gt;A functional approach involves composing the problem as a set of functions to be executed.&lt;/li&gt;
&lt;li&gt;In software, everything is a statement, unless it is a function.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Procedural Programming&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Procedural programming is a programming paradigm, derived from structured programming&lt;/li&gt;
&lt;li&gt;Based upon the concept of the procedure call. Procedures&lt;/li&gt;
&lt;li&gt;Also known as routines, subroutines, or functions, simply contain a series of computational steps to be carried out.&lt;/li&gt;
&lt;li&gt;Any given procedure might be called at any point during a program&#39;s execution, including by other procedures or itself.&lt;/li&gt;
&lt;li&gt;Procedural programming (PP), also known as inline programming takes a top-down approach.&lt;/li&gt;
&lt;li&gt;It is about writing a list of instructions to tell the computer what to do step by step.&lt;/li&gt;
&lt;li&gt;It relies on procedures or routines.&lt;/li&gt;
&lt;li&gt;Procedural programming is a type of imperative programming in which the program is built from one or more procedures (also termed subroutines or functions).&lt;/li&gt;
&lt;li&gt;Procedural programming could be considered a step towards declarative programming.&lt;/li&gt;
&lt;li&gt;A programmer can often tell, simply by looking at the names, arguments, and return types of procedures (and related comments), what a particular procedure is supposed to do, without necessarily looking at the details of how it achieves its result.&lt;/li&gt;
&lt;li&gt;At the same time, a complete program is still imperative since it fixes the statements to be executed and their order of execution to a large extent.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/1309751627529351666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2019/01/structuredimperativefunctionalprocedura.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/1309751627529351666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/1309751627529351666'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2019/01/structuredimperativefunctionalprocedura.html' title='Structured/Imperative/Functional/Procedural Programming'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-5150528097940485522</id><published>2018-10-15T18:24:00.002+05:30</published><updated>2021-05-31T10:25:58.404+05:30</updated><title type='text'>Singleton Pattern</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;Singleton Pattern&lt;/span&gt;&lt;/b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;&amp;nbsp;belongs to&amp;nbsp;&lt;b&gt;Creational type pattern&lt;/b&gt;. As the name implies, creational design type deals with object creation mechanisms. Basically, to simplify this, creational pattern explains us the creation of objects in a manner suitable to a given situation.&lt;/span&gt;&amp;nbsp;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Singleton design pattern is used when we need to ensure that only one object of a particular class is Instantiated. That single instance created is responsible to coordinate actions across the application.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjRsTQEdy7X4A1PRwPqXZ9XDjcX61mzkJY-OCOVXK6l8xg8aKYaN8s9fKok-okhd6M0SjFpuB7TFvFPROE3Mv0r_wLl4XbZmsaw52m-fDChjek7HzjkhqtEzijE3D4-2TksIpSbDeNWUFf/s1600/DesignPattern.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;196&quot; data-original-width=&quot;383&quot; height=&quot;163&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjRsTQEdy7X4A1PRwPqXZ9XDjcX61mzkJY-OCOVXK6l8xg8aKYaN8s9fKok-okhd6M0SjFpuB7TFvFPROE3Mv0r_wLl4XbZmsaw52m-fDChjek7HzjkhqtEzijE3D4-2TksIpSbDeNWUFf/s320/DesignPattern.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;If you look at the illustrated diagram above, you will see different objects trying to invoke an object instantiated as singleton. This single instance of the object is responsible to invoke underneath methods or events.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;Advantages and Guidelines for Singleton implementation.&lt;/span&gt;&lt;/b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;br /&gt;&lt;br /&gt;Concurrent access to the resource is well managed by singleton design pattern.&lt;br /&gt;&lt;br /&gt;As part of the Implementation guidelines we need to ensure that only one instance of the class exists by declaring all constructors of the class to be private. &amp;nbsp;Also, to control the singleton access we need to provide a static property that returns a single instance of the object.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Singleton Class Implementation Example&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 1pt;&quot;&gt;
&lt;b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Program.cs&lt;/span&gt;&lt;/b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 1pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;namespace&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;SingletonDemo&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;{&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;class&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Program&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;static&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;void&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;Main(&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;string&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;[] args)&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;/*&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Assuming Singleton is created from employee class&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * we refer to the GetInstance property from the Singleton class&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;fromEmployee =&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;.GetInstance;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fromEmployee.PrintDetails(&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&quot;From Employee&quot;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;);&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;/*&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Assuming Singleton is created from student class&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * we refer to the GetInstance property from the Singleton class&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;fromStudent =&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;.GetInstance;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fromStudent.PrintDetails(&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&quot;From Student&quot;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;);&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Console&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;.ReadLine();&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 1pt;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 1pt;&quot;&gt;
&lt;b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton.cs&lt;/span&gt;&lt;/b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;namespace&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;SingletonDemo&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;{&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;/*&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&amp;nbsp; Sealed ensures the class being inherited and&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&amp;nbsp; object instantiation is restricted in the derived class&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;public&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;sealed&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;class&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;private&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;static&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;int&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;counter = 0;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;/*&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Private property initilized with null&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * ensures that only one instance of the object is created&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * based on the null condition&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;private&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;static&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;instance =&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;null&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;/*&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * public property is used to return only one instance of the class&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * leveraging on the private property&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;public&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;static&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;GetInstance&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;get&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;if&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;(instance ==&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;null&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;)&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; instance =&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;new&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;();&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;return&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;instance;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;/*&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Private constructor ensures that object is not&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * instantiated other than with in the class itself&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;private&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;Singleton()&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter++;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Console&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;.WriteLine(&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&quot;Counter Value &quot;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;+ counter.ToString());&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;/*&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Public method which can be invoked through the singleton instance&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;public&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;void&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;PrintDetails(&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;string&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;message)&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Console&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;.WriteLine(message);&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;}&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;Lazy Initialization in Singleton :&lt;/span&gt;&lt;/b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;&amp;nbsp;GetInstance Property is responsible for the Singleton Instance creation. Singleton object is not instantiated until and unless&amp;nbsp;&lt;b&gt;GetInstance&lt;/b&gt;&amp;nbsp;is invoked. Hence, there is a delay in instance creation till the GetInstance is accessed. This Delay in Instance creation is called Lazy Initialization.&lt;/span&gt;&amp;nbsp;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;How to use Multithreads in Singleton :&amp;nbsp;&lt;/b&gt;The lazy initialization works perfectly well when we invoke the GetInstance in a Single threaded approach. However, there is a chance that we may end up creating multiple instances when multiple threads invoke the GetInstance at the same time.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This Thread racing situation causes thread safety issues in Singleton Initialization and further the current code ends up in creating multiple instances of Singleton objects in memory.&lt;br /&gt;
&lt;br /&gt;
To achieve and replicate multiple threads accessing GetInstance, We have modified the main program by using Parallel.Invoke method of .NET Framework 4.0. &amp;nbsp;Please refer to Main program code below for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;How to implement a Thread Safe singleton class :&lt;/b&gt;&amp;nbsp;Locks are the best way to control thread race condition and they help us to overcome the present situation. Please refer to the Singleton.cs code for lock checks and double check locking.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;static&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;void&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;Main(&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;string&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;[] args)&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Parallel&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;.Invoke(&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; () =&amp;gt; PrintStudentdetails(),&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; () =&amp;gt; PrintEmployeeDetails()&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Console&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;.ReadLine();&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;&quot;&gt;private&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;&quot;&gt;static&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;&quot;&gt;readonly&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;&quot;&gt;object&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;&quot;&gt;&amp;nbsp;obj =&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;&quot;&gt;new&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;&quot;&gt;object&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;&quot;&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;public&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;static&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;GetInstance&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;get&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;if&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;(instance ==&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;null&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;)&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;lock&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;(obj)&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;if&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;(instance ==&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;null&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;)&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; instance =&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;new&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;();&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;return&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;instance;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;Difference between&amp;nbsp;Lazy Initialization and Eager Initialization&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;&lt;u&gt;Lazy Initialization:&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;The lazy initialization of an object improves the performance and avoids unnecessary computation till the point the object is accessed. Further, it reduces the memory footprint during the start-up of the program. Reducing the memory print will help faster loading of the application.&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Non-Lazy or Eager Loading:&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;Eager loading is nothing but to initialize the required object before it’s being accessed. &amp;nbsp;Which means, we instantiate the object and keep it ready and use it when we need it. This type of initialization is used in lower memory footprints. Also, in eager loading, the common language runtime takes care of the variable initialization and its thread safety. Hence, we don’t need to write any explicit coding for thread safety.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Singleton with Lazy keyword (.NET 4.0):&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Lazy keyword provides support for lazy initialization. In order to make a property as lazy, we need to pass the type of object to the lazy keyword which is being lazily initialized.&lt;br /&gt;
&lt;br /&gt;
By default, Lazy&amp;lt;T&amp;gt; objects are thread-safe. &amp;nbsp;In multi-threaded scenarios, the first thread which tries to access the Value property of the lazy object will take care of thread safety when multiple threads are trying to access the Get Instance at the same time.&lt;br /&gt;
&lt;br /&gt;
Therefore, it does not matter which thread initializes the object or if there are any thread race conditions that are trying to access this property.&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;private&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;static&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;readonly&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Lazy&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;gt; instance =&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;new&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Lazy&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;gt;(()=&amp;gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;new&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;());&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;&lt;u&gt;Differences between Singleton and static classes&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 3pt 36pt; text-indent: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: Arial; mso-fareast-language: EN-IN;&quot;&gt;1.&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;; font-size: 7pt; font-stretch: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Static is a keyword and Singleton is a design pattern&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 3pt 36pt; text-indent: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: Arial; mso-fareast-language: EN-IN;&quot;&gt;2.&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;; font-size: 7pt; font-stretch: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Static classes can contain only static members&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 3pt 36pt; text-indent: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: Arial; mso-fareast-language: EN-IN;&quot;&gt;3.&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;; font-size: 7pt; font-stretch: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton is an object creational pattern with one instance of the class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 3pt 36pt; text-indent: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: Arial; mso-fareast-language: EN-IN;&quot;&gt;4.&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;; font-size: 7pt; font-stretch: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton can implement interfaces, inherit from other classes and it aligns with the OOPS concepts&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 3pt 36pt; text-indent: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: Arial; mso-fareast-language: EN-IN;&quot;&gt;5.&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;; font-size: 7pt; font-stretch: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton object can be passed as a reference&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 3pt 36pt; text-indent: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: Arial; mso-fareast-language: EN-IN;&quot;&gt;6.&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;; font-size: 7pt; font-stretch: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton supports object disposal&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 3pt 36pt; text-indent: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: Arial; mso-fareast-language: EN-IN;&quot;&gt;7.&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;; font-size: 7pt; font-stretch: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton object is stored on heap&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 3pt 36pt; text-indent: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: Arial; mso-fareast-language: EN-IN;&quot;&gt;8.&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;; font-size: 7pt; font-stretch: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton objects can be cloned&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;&lt;u&gt;Real world usage of Singleton:&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;Listed are few real world scenarios for singleton usage&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 3pt 36pt; text-indent: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: Arial; mso-fareast-language: EN-IN;&quot;&gt;1.&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;; font-size: 7pt; font-stretch: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Exception/Information logging&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 3pt 36pt; text-indent: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: Arial; mso-fareast-language: EN-IN;&quot;&gt;2.&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;; font-size: 7pt; font-stretch: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Connection pool management&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 3pt 36pt; text-indent: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: Arial; mso-fareast-language: EN-IN;&quot;&gt;3.&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;; font-size: 7pt; font-stretch: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;File management&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 3pt 36pt; text-indent: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: Arial; mso-fareast-language: EN-IN;&quot;&gt;4.&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;; font-size: 7pt; font-stretch: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Device management such as printer spooling&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 3pt 36pt; text-indent: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: Arial; mso-fareast-language: EN-IN;&quot;&gt;5.&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;; font-size: 7pt; font-stretch: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Application Configuration management&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 3pt 36pt; text-indent: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: Arial; mso-fareast-language: EN-IN;&quot;&gt;6.&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;; font-size: 7pt; font-stretch: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Cache management&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 3pt 36pt; text-indent: 0cm;&quot;&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: Arial; mso-fareast-language: EN-IN;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;7.&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;And Session based shopping cart are some of the real world usage of singleton design pattern&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 3pt 36pt; text-indent: 0cm;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;/span&gt;

  &lt;/div&gt;
 
&lt;/div&gt;&lt;b&gt;
Additional Examples&lt;/b&gt;&lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/ddevashish/DesignPattern/blob/master/DesignPattern/Singleton.cs&quot; target=&quot;_blank&quot;&gt;Singleton Sample Example&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/ddevashish/DesignPattern/blob/master/DesignPattern/SingletonEager.cs&quot; target=&quot;_blank&quot;&gt;Singleton Eager Example&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/ddevashish/DesignPattern/blob/master/DesignPattern/SingletonLazy.cs&quot; target=&quot;_blank&quot;&gt;Singleton Lazy Example&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;Real World Example&lt;/b&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/ddevashish/DesignPattern/blob/master/DesignPattern/Implementation/Singleton/Connection.cs&quot; target=&quot;_blank&quot;&gt;Connection&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/ddevashish/DesignPattern/blob/master/DesignPattern/Implementation/Singleton/ExceptionLog.cs&quot; target=&quot;_blank&quot;&gt;ExceptionLog&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/ddevashish/DesignPattern/blob/master/DesignPattern/Implementation/Singleton/Log.cs&quot; target=&quot;_blank&quot;&gt;Log&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/5150528097940485522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2018/10/singleton-pattern.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/5150528097940485522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/5150528097940485522'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2018/10/singleton-pattern.html' title='Singleton Pattern'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjRsTQEdy7X4A1PRwPqXZ9XDjcX61mzkJY-OCOVXK6l8xg8aKYaN8s9fKok-okhd6M0SjFpuB7TFvFPROE3Mv0r_wLl4XbZmsaw52m-fDChjek7HzjkhqtEzijE3D4-2TksIpSbDeNWUFf/s72-c/DesignPattern.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-240646765835567135</id><published>2018-10-15T18:23:00.003+05:30</published><updated>2021-05-31T10:35:55.365+05:30</updated><title type='text'>Design Patterns</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;Design patterns&lt;/span&gt;&lt;/b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;&amp;nbsp;are reusable solutions to the problems that we encounter in the day to day programming.&amp;nbsp;&lt;/span&gt;They are generally targeted at solving the problems of object generation and integration. In other words, Design&amp;nbsp;patterns acts as templates which can be applied to the real-world programming problems.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;Design patterns&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;are solutions to software design problems you find again and again in real-world application development. Patterns are about reusable designs and interactions of objects.&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot;&gt;&lt;u&gt;Types of Design Patterns&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;Gang of Four have categorised&amp;nbsp;the design patterns in to 3 types based on different problems encountered in the real world applications. They are&amp;nbsp;&lt;b&gt;Creational&lt;/b&gt;,&amp;nbsp;&lt;b&gt;Structural&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;Behavioural&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Creational design patterns :&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;These patterns deal with object creation and initialization. Creational pattern gives the program more flexibility in deciding which objects need to be created for a given case.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Examples:&amp;nbsp;&lt;/b&gt;&lt;a href=&quot;https://ddevblog1.blogspot.com/2018/10/singleton-pattern.html&quot; target=&quot;_blank&quot;&gt;Singleton&lt;/a&gt; , Factory and Abstract Factory etc.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Structural design patterns :&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;This pattern deals with class and object composition. In simple words, This pattern focuses on decoupling interface, implementation of classes and its objects.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Examples:&amp;nbsp;&lt;/b&gt;Adapter, &amp;nbsp;Facade and Bridge etc.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Behavioural design patterns :&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span face=&quot;&amp;quot;arial&amp;quot; , sans-serif&quot; style=&quot;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;These patterns deal with communication between Classes and objects.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Examples:&lt;/b&gt;&amp;nbsp;Chain of Responsibility, Command and Interpreter etc.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;&lt;a href=&quot;https://github.com/ddevashish/DesignPattern&quot; target=&quot;_blank&quot;&gt;Design Pattern Sample with Real world examples&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/240646765835567135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2018/10/design-patterns.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/240646765835567135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/240646765835567135'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2018/10/design-patterns.html' title='Design Patterns'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-9125950989059340157</id><published>2018-10-15T14:44:00.004+05:30</published><updated>2018-10-15T14:44:45.558+05:30</updated><title type='text'>Class &amp; Object</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;&lt;u&gt;Class:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Blue Print (set of instruction to build a specific type of object) or prototype that defines the variables and the methods (functions) common to all objects of a certain kind.&lt;/li&gt;
&lt;li&gt;Class is just logical representation.&lt;/li&gt;
&lt;li&gt;Not stored in any memory.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Object&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Instance of class.&lt;/li&gt;
&lt;li&gt;Physical representation of the class.&lt;/li&gt;
&lt;li&gt;Block of memory that has been allocated.&lt;/li&gt;
&lt;li&gt;Stored in memory (i.e variables present in class).&lt;/li&gt;
&lt;li&gt;Helps us to access the member of a class or struct either they can be fields, methods or properties&lt;/li&gt;
&lt;li&gt;A program may create many objects of the same class.&lt;/li&gt;
&lt;li&gt;Consists of methods and properties to make a particular type of data useful&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Class Vs Object&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Class is a template from which objects are created.&lt;/li&gt;
&lt;li&gt;Object determines the behavior of the class.&lt;/li&gt;
&lt;li&gt;Class is an entity that determines how an object will behave and what the object will contain.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/9125950989059340157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2018/10/class-object.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/9125950989059340157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/9125950989059340157'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2018/10/class-object.html' title='Class &amp; Object'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-658192158131537670</id><published>2018-10-13T22:03:00.000+05:30</published><updated>2018-10-13T22:03:10.296+05:30</updated><title type='text'>Wrapper Class</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
If we want to hide some set of logic (written in some class)
and/or attributes from outside the world then instead of adding access modifier
(private specially), we can move all those logic and attributes to some place
(class, which encapsulate attributes and actions) and wrap that class within
the another class. So by this way we can hide the whole logic from outside the
class as by creating the object of the wrapper class we cannot access the
method inside the wrapped class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;u&gt;E.G.&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
public class WrapperClass&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public int
AddNumber(int a, int b)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;return a +
b;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public void
AddNumberW(int a, int b)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;WrappedClass wc = new WrappedClass();&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;Console.WriteLine(&quot;Adding specific values using default constrctor=
&quot; + wc.AddNumberW(3,5));&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public class
WrappedClass&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public int
AddNumberW(int a, int b)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;return
a + b;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/658192158131537670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2018/10/wrapper-class.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/658192158131537670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/658192158131537670'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2018/10/wrapper-class.html' title='Wrapper Class'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-315095136445744066</id><published>2018-10-12T15:55:00.000+05:30</published><updated>2018-10-12T18:20:30.048+05:30</updated><title type='text'>Managed Heap</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Address spaces, created by processes at run time.&lt;br /&gt;
&lt;br /&gt;
Work based on automatic memory management.&lt;br /&gt;
&lt;br /&gt;
Microsoft’s .NET framework uses a managed heap model as part of its automatic memory management process.&lt;br /&gt;
&lt;br /&gt;
When you create an object using the new operator in C#, the .NET run time allocates memory in the &quot;managed heap&quot; (simply a heap managed by the .NET run time + the garbage collector).&lt;br /&gt;
&lt;br /&gt;
Automatic memory management is one of the services that the Common Language Run time provides during Managed Execution.&lt;br /&gt;
&lt;br /&gt;
The Common Language Run time&#39;s garbage collector manages the allocation and release of memory for an application. For developers, this means that you do not have to write code to perform memory management tasks when you develop managed applications. Automatic memory management can eliminate common problems, such as forgetting to free an object and causing a memory leak, or attempting to access memory for an object that has already been freed.&lt;br /&gt;
&lt;br /&gt;
When you initialize a new process, the run time reserves a contiguous region of address space for the process. This reserved address space is called the managed heap. The managed heap maintains a pointer to the address where the next object in the heap will be allocated. Initially, this pointer is set to the managed heap&#39;s base address. All reference types are allocated on the managed heap. When an application creates the first reference type, memory is allocated for the type at the base address of the managed heap. When the application creates the next object, the garbage collector allocates memory for it in the address space immediately following the first object. As long as address space is available, the garbage collector continues to allocate space for new objects in this manner.&lt;br /&gt;
&lt;br /&gt;
Allocating memory from the managed heap is faster than unmanaged memory allocation. Because the run time allocates memory for an object by adding a value to a pointer, it is almost as fast as allocating memory from the stack. In addition, because new objects that are allocated consecutively are stored contiguously in the managed heap, an application can access the objects very quickly.&lt;br /&gt;
&lt;br /&gt;
The garbage collector&#39;s optimizing engine determines the best time to perform a collection based on the allocations being made. When the garbage collector performs a collection, it releases the memory for objects that are no longer being used by the application. It determines which objects are no longer being used by examining the application&#39;s roots. Every application has a set of roots. Each root either refers to an object on the managed heap or is set to null. An application&#39;s roots include static fields, local variables and parameters on a thread&#39;s stack, and CPU registers.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA6STP-HFp9LZVRjVZvC10Vg9TrO8tL-p_k8KKHH88NtyQhMMyypHHrHkUDsAEaaf4jJXBHWPFB-Aw8bBKuQRcnL5cDGlguzz0Em92rSyipy5cbj1GFrRXjmlOs0FNuLKt12l3aBCF6Wdm/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;402&quot; data-original-width=&quot;372&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA6STP-HFp9LZVRjVZvC10Vg9TrO8tL-p_k8KKHH88NtyQhMMyypHHrHkUDsAEaaf4jJXBHWPFB-Aw8bBKuQRcnL5cDGlguzz0Em92rSyipy5cbj1GFrRXjmlOs0FNuLKt12l3aBCF6Wdm/s320/Capture.PNG&quot; width=&quot;296&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Objects that are not in the graph are unreachable from the application&#39;s roots. The garbage collector considers unreachable objects garbage and will release the memory allocated for them. During a collection, the garbage collector examines the managed heap, looking for the blocks of address space occupied by unreachable objects. As it discovers each unreachable object, it uses a memory-copying function to compact the reachable objects in memory, freeing up the blocks of address spaces allocated to unreachable objects. Once the memory for the reachable objects has been compacted, the garbage collector makes the necessary pointer corrections so that the application&#39;s roots point to the objects in their new locations. It also positions the managed heap&#39;s pointer after the last reachable object. Note that memory is compacted only if a collection discovers a significant number of unreachable objects. If all the objects in the managed heap survive a collection, then there is no need for memory compaction.&lt;br /&gt;
&lt;br /&gt;
To improve performance, the run time allocates memory for large objects in a separate heap. The garbage collector automatically releases the memory for large objects. However, to avoid moving large objects in memory, this memory is not compacted.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/315095136445744066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2018/10/managed-heap.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/315095136445744066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/315095136445744066'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2018/10/managed-heap.html' title='Managed Heap'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA6STP-HFp9LZVRjVZvC10Vg9TrO8tL-p_k8KKHH88NtyQhMMyypHHrHkUDsAEaaf4jJXBHWPFB-Aw8bBKuQRcnL5cDGlguzz0Em92rSyipy5cbj1GFrRXjmlOs0FNuLKt12l3aBCF6Wdm/s72-c/Capture.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-2253457044110361446</id><published>2018-10-10T17:26:00.004+05:30</published><updated>2021-06-07T22:06:02.919+05:30</updated><title type='text'>Struct</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Struct is an encapsulated entity. Struct doesn&#39;t uses
complete oops concept but are used for user defined data type. All the member
of the struct has to be initialized, as it is value type.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;A struct is a simple user-defined type, a lightweight
alternative to a class.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Similar to classes, structures have behaviors and
attributes. As a value type, structures directly contain their value so their
object or instance is stored on the stack.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Struts support access modifiers, constructors, indexers,
methods, fields, nested types, operators, and properties.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Whenever you have a need for a type that will be used often
and is mostly just a piece of data, structs might be a good option. In the
other words when we have small and frequent use of some work use structs over
classes.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Structs reside on the stack, so we should keep them small.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;The default constructor of a structure initializes each field
to a default value. You cannot replace the default constructor of a structure.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;You can&#39;t define destructor for structs&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;E.G.&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
public struct Student {&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;
&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;int id;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;int zipcode;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;double
salary;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
} &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Q: Is Structure reference type?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
A: No, it is value type&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Q: Is Structure support default (parameter less)
constructor?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
A: No&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Q: Is Structure support parameterized constructor?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
A: Yes&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Q: Is Structure support uninitialized valued (attributes)?&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
A: No, all values must be initialized within constructor. We
cannot initialize value during declaration.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Q: Can Structure be inherited?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
A: No, they are sealed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Q: Can class be inheriting to Structure?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
A: No. Struct can&#39;t derive from any class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Q: Can Interface be inheriting to Structure?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
A: Yes. Struct can be derive from interface only.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Q: Can Structure member be declared protected?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
A: No, as Structure cannot inherited.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u&gt;Structure VS Class&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;&quot;&gt;
 &lt;tbody&gt;
&lt;tr style=&quot;mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;
  &lt;td style=&quot;border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 225.4pt;&quot; valign=&quot;top&quot; width=&quot;301&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: center;&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Structs&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-left: none; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 225.4pt;&quot; valign=&quot;top&quot; width=&quot;301&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: center;&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Class&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 1;&quot;&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 225.4pt;&quot; valign=&quot;top&quot; width=&quot;301&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
Value Type&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 225.4pt;&quot; valign=&quot;top&quot; width=&quot;301&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
Reference Type&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 2;&quot;&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 225.4pt;&quot; valign=&quot;top&quot; width=&quot;301&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
Stored in stack&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 225.4pt;&quot; valign=&quot;top&quot; width=&quot;301&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
Stored on managed heap&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 3;&quot;&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 225.4pt;&quot; valign=&quot;top&quot; width=&quot;301&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
Doesn’t support inheritance with class&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 225.4pt;&quot; valign=&quot;top&quot; width=&quot;301&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
Support Inheritance&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 4;&quot;&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 225.4pt;&quot; valign=&quot;top&quot; width=&quot;301&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
Cannot define default constructor&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 225.4pt;&quot; valign=&quot;top&quot; width=&quot;301&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
Constructor is fully supported&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 5; mso-yfti-lastrow: yes;&quot;&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 225.4pt;&quot; valign=&quot;top&quot; width=&quot;301&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
Cannot define default destructor&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 225.4pt;&quot; valign=&quot;top&quot; width=&quot;301&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
Destructor is fully supported&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 5; mso-yfti-lastrow: yes;&quot;&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 225.4pt;&quot; valign=&quot;top&quot; width=&quot;301&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
Uninitialized member not possible&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 225.4pt;&quot; valign=&quot;top&quot; width=&quot;301&quot;&gt;Uninitialized member possible
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/2253457044110361446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2018/10/struct.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/2253457044110361446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/2253457044110361446'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2018/10/struct.html' title='Struct'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-4502064988923745392</id><published>2018-09-26T15:57:00.001+05:30</published><updated>2018-09-26T15:57:31.596+05:30</updated><title type='text'>Object Relational Mapping (ORM)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;(ORM)&lt;/b&gt; is a
technique that lets you query and manipulate data from a database using an
object-oriented paradigm&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
An ORM library is a completely ordinary library written in
your language of choice that encapsulates the code needed to manipulate the
data, so you don&#39;t use SQL anymore; you interact directly with an object in the
same language you&#39;re using&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;E.G.&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
book_list = new List();&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
sql = &quot;SELECT book FROM library WHERE author =
&#39;Linus&#39;&quot;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
data = query(sql); // I over simplify ...&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
while (row = data.next())&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
{&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;book = new
Book();&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;book.setAuthor(row.get(&#39;author&#39;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;book_list.add(book);&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
}&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
With an ORM library, it would look like this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
book_list = BookTable.query(author=&quot;Linus&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;u&gt;Disadvantage of
ORM&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;ORM libraries are not lightweight tools;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Performance is OK for usual queries, but a SQL
master will always do better with his own SQL for big projects.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Example of ORM&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Entity Framework&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/4502064988923745392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2018/09/object-relational-mapping-orm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/4502064988923745392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/4502064988923745392'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2018/09/object-relational-mapping-orm.html' title='Object Relational Mapping (ORM)'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-2705830599146906955</id><published>2018-09-26T15:25:00.006+05:30</published><updated>2021-05-17T10:10:06.424+05:30</updated><title type='text'>SQL Theory Interview Questions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;u&gt;1. Advantages and
Disadvantages of Stored Procedure&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Stored procedure can be used as a modular programming –
means create once, store and call for several times whenever required.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
This supports faster execution instead of executing multiple
queries. This reduces network traffic and provides better security to the data.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Disadvantage&lt;/b&gt; is
that it can be executed only in the Database and utilizes more memory in the
database server.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;2. What are different SQL statement&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;There are 3 types of &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;SQL
statements&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
1) &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;DDL&lt;/b&gt; &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;(Data Definition Language):&lt;/b&gt; It is used
to define the database structure such as tables. It includes three statements
such as Create, Alter, and Drop.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Some of the DDL Commands are listed below&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
CREATE: It is used for creating the table.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
CREATE TABLE&amp;amp;amp;amp;amp;nbsp;table_name&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
column_name1 data_type(size),&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
column_name2 data_type(size),&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
column_name3 data_type(size),&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
ALTER: The ALTER table is used for modifying the existing
table object in the database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
ALTER TABLE table_name&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
ADD column_name datatype&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
ALTER TABLE table_name&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
DROP COLUMN column_name&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
2) &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;DML (Data
Manipulation Language):&lt;/b&gt; These statements are used to manipulate the data in
records. Commonly used DML statements are Insert, Update, and Delete.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
The Select statement is used as partial DML statement that
is used to select all or relevant records in the table.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
3) &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;DCL (Data Control
Language):&lt;/b&gt; These statements are used to set privileges such as Grant and
Revoke database access permission to the specific user.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;What are different
JOINS used in SQL?&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18pt;&quot;&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Right Join&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18pt;&quot;&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Outer Join&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18pt;&quot;&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Full Join&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18pt;&quot;&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Cross Join&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18pt;&quot;&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Self Join&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;3. What is SQL
Injection?&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
SQL Injection is a type of database attack technique where
malicious SQL statements are inserted into an entry field of database such that
once it is executed the database is opened for an attacker. This technique is
usually used for attacking Data-Driven Applications to have an access to
sensitive data and perform administrative tasks on databases.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;4. What is the
difference between DELETE and TRUNCATE?&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
The basic difference in both is DELETE is DML command and
TRUNCATE is DDL&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
DELETE is used to delete a specific row from the table
whereas TRUNCATE is used to remove all rows from the table&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
We can use DELETE with WHERE clause but cannot use TRUNCATE
with it&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;5. What is the
difference between DROP and TRUNCATE?&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
TRUNCATE removes all rows from the table which cannot be
retrieved back, DROP removes the entire table from the database and it cannot
be retrieved back.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;6. What is Trigger? &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Ans. Trigger allows us to execute a batch of SQL code when a
table event occurs (Insert, update or delete command executed against a
specific table)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
A SQL trigger is a special type of stored procedure. It is
special because it is not called directly like a stored procedure. The main
difference between a trigger and a stored procedure is that a trigger is called
automatically when a data modification event is made against a table whereas a
stored procedure must be called explicitly.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;7. Advantages of using
SQL triggers&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
SQL triggers provide an alternative way to check the
integrity of data.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
SQL triggers provide an alternative way to run scheduled
tasks. By using SQL triggers, you don’t have to wait to run the scheduled tasks
because the triggers are invoked automatically before or after a change is made
to the data in the tables.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
SQL triggers are very useful to audit the changes of data in
tables.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;u&gt;Types of Trigger&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;DDL Triggers&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
In SQL Server we can create triggers on DDL statements (like
CREATE, ALTER, and DROP) and certain system defined stored procedures that
perform DDL-like operations.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;DML Triggers&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
In SQL Server we can create triggers on DML statements (like
INSERT, UPDATE, and DELETE) and stored procedures that perform DML-like
operations. DML Triggers are of two types&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;After Trigger (using
FOR/AFTER CLAUSE)&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
This type of trigger fires after SQL Server finish the
execution of the action successfully that fired it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Instead of Trigger
(using INSTEAD OF CLAUSE)&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
This type of trigger fires before SQL Server starts the
execution of the action that fired it. This is differ from the AFTER trigger,
which fires after the action that caused it to fire. We can have an INSTEAD OF
insert/update/delete trigger on a table that successfully executed but does not
include the actual insert/update/delete to the table.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;8. What are the
properties of a transaction?&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;ACID&lt;/b&gt;&amp;nbsp;(an acronym for Atomicity, Consistency
Isolation, Durability) is a concept that Database Professionals generally look
for when evaluating databases and application architectures. For a reliable
database all these four attributes should be achieved.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;Atomicity&lt;/b&gt;&amp;nbsp;is an all-or-none proposition.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;Consistency&lt;/b&gt;&amp;nbsp;guarantees that a transaction never
leaves your database in a half-finished state.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;Isolation&lt;/b&gt;&amp;nbsp;keeps transactions separated from each
other until they’re finished.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;Durability&lt;/b&gt;&amp;nbsp;guarantees that the database will
keep track of pending changes in such a way that the server can recover from an
abnormal termination.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/2705830599146906955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2018/09/sql-interview-questions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/2705830599146906955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/2705830599146906955'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2018/09/sql-interview-questions.html' title='SQL Theory Interview Questions'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7063370021399208544.post-2281641730593970524</id><published>2018-09-26T14:35:00.007+05:30</published><updated>2021-05-17T10:10:47.534+05:30</updated><title type='text'>SQL</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;https://ddevblog1.blogspot.com/2018/06/normalization.html&quot; target=&quot;_blank&quot;&gt;Normalization&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://ddevblog1.blogspot.com/2018/09/view-sql.html&quot; target=&quot;_blank&quot;&gt;View&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://ddevblog1.blogspot.com/2018/09/index-sql.html&quot; target=&quot;_blank&quot;&gt;Index&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://ddevblog1.blogspot.com/2018/09/sql-interview-questions.html&quot;&gt;SQL Theory Interview Questions&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://ddevblog1.blogspot.com/2021/05/interview-questions-queries.html&quot;&gt;SQL Queries Interview Questions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ddevblog1.blogspot.com/feeds/2281641730593970524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ddevblog1.blogspot.com/2018/09/sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/2281641730593970524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7063370021399208544/posts/default/2281641730593970524'/><link rel='alternate' type='text/html' href='http://ddevblog1.blogspot.com/2018/09/sql.html' title='SQL'/><author><name>Dev</name><uri>http://www.blogger.com/profile/15591592958539136524</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_u3l0TQazp8H6LMjRYjE_3fTwOmgvClEzO1IkYlmqg7VG4h8gGQwxjbqNsYmAR1b8jFuN0-RI2Yhs67ulYJPfXVCmzolCCunE6eO2_WLQmywU6DJb01Boi-HFkGEkgrk/s113/*'/></author><thr:total>0</thr:total></entry></feed>