<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://www.dflying.net/styles/rss.css" type="text/css"?>
<rdf:RDF 
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
  xmlns="http://my.netscape.com/rdf/simple/0.9/"
>

 <channel>
  <title>David&#039;s Untitled Life</title>
  <link>http://blueoxygen.dflying.net/3</link>
  <description>ERP,CRM,BW,SAP,Accounting...</description>
 </channel>
    <item>
   <title>Learn JAVA5 Tiger from sample codes: avargs</title>
   <description>&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;http://blueoxygen.dflying.net/plugins/plogeshi/styles/plogeshi.css&quot; /&gt;&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt;   &lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt;  Artist   &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    
    &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;String&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; others;
     &lt;span class=&quot;coMULTI&quot;&gt;/** */&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/**  Creates a new instance of Artist  */&lt;/span&gt; 
      &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt;  Artist&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;   &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; 
      &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt;  Artist&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;String&lt;/span&gt;&lt;/a&gt; name,&lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;String&lt;/span&gt;&lt;/a&gt; ... &lt;span class=&quot;me1&quot;&gt;others&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;  &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
         &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;String&lt;/span&gt;&lt;/a&gt; other : others&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;  &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;other&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; 
         &lt;span class=&quot;kw2&quot;&gt;this&lt;/span&gt; .&lt;span class=&quot;me1&quot;&gt;others&lt;/span&gt;  =  others;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; 
      &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt;   &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;  wildestMethod&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?q=allinurl%3AObject+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Object&lt;/span&gt;&lt;/a&gt; ... &lt;span class=&quot;me1&quot;&gt;objs&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;  &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
     &lt;span class=&quot;co1&quot;&gt;// this method will accept any arguments &lt;/span&gt;
     &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; 
      &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt;   &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt;   &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;  main&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;String&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; args&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;  &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        Artist artist  =   &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt;  Artist&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot; You &quot;&lt;/span&gt; ,  &lt;span class=&quot;st0&quot;&gt;&quot; 1 &quot;&lt;/span&gt; ,  &lt;span class=&quot;st0&quot;&gt;&quot; 2 &quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        artist.&lt;span class=&quot;me1&quot;&gt;wildestMethod&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; ,  &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;.&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt; ,  &lt;span class=&quot;st0&quot;&gt;&quot; AA &quot;&lt;/span&gt; ,  &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt;  Artist&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; 
    
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br/&gt;</description>
   <link>http://blueoxygen.dflying.net/3/archive/168_learn_java5_tiger_from_sample_codes_avargs.html</link>
      <pubDate>Mon, 26 Jun 2006 14:02:40 +0100</pubDate>   
  </item>
    <item>
   <title>Learn JAVA5 Tiger from sample codes: Auto Boxing and Unboxing</title>
   <description>&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;http://blueoxygen.dflying.net/plugins/plogeshi/styles/plogeshi.css&quot; /&gt;&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; AutoBoxing &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    
    &lt;span class=&quot;coMULTI&quot;&gt;/** Creates a new instance of AutoBoxing */&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; AutoBoxing&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; boxingDemo&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;//auto boxing&lt;/span&gt;
        &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AInteger+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Integer&lt;/span&gt;&lt;/a&gt; i = &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;;
        float f = &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.66f;
        &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AFloat+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Float&lt;/span&gt;&lt;/a&gt; F = f;
        &lt;span class=&quot;co1&quot;&gt;//auto unboxing&lt;/span&gt;
        &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AInteger+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Integer&lt;/span&gt;&lt;/a&gt; I = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AInteger+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Integer&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i2 = I;
        &lt;span class=&quot;co1&quot;&gt;//null value test, it will case NullPointerException&lt;/span&gt;
        &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AInteger+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Integer&lt;/span&gt;&lt;/a&gt; I2 = &lt;span class=&quot;kw2&quot;&gt;null&lt;/span&gt;;
        &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i3 = I2;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; testOperator&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AInteger+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Integer&lt;/span&gt;&lt;/a&gt; i = &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;;
        &lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            i++;
            &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;Counter:&quot;&lt;/span&gt;+i&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
            &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i&amp;gt;&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt;;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; testCompare&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;//it&#039;s equal because -127~127 are immutable objects&lt;/span&gt;
        &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AInteger+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Integer&lt;/span&gt;&lt;/a&gt; i = &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;;
        &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AInteger+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Integer&lt;/span&gt;&lt;/a&gt; i2 = &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;;
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i == i2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;1:Equal&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;1:Not Equal&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;co1&quot;&gt;//it&#039;s not equal because j and j2 are different objects&lt;/span&gt;
        &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AInteger+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Integer&lt;/span&gt;&lt;/a&gt; j = &lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt;;
        &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AInteger+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Integer&lt;/span&gt;&lt;/a&gt; j2 =&lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt;;
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;j == j2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;200:Equal&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;200:Not Equal&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; testControl&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ABoolean+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Boolean&lt;/span&gt;&lt;/a&gt; flag = &lt;span class=&quot;kw2&quot;&gt;true&lt;/span&gt;;
        &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AInteger+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Integer&lt;/span&gt;&lt;/a&gt; i = &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;;
        &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AInteger+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Integer&lt;/span&gt;&lt;/a&gt; j = &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;;
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;flag&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;Boolean affects&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i&amp;lt;j&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;Integer affects&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; testMethod&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;double&lt;/span&gt; arg&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;public void testMethod(double arg) is invoked&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; testMethod&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?q=allinurl%3AInteger+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Integer&lt;/span&gt;&lt;/a&gt; arg&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;public void testMethod2(Integer arg) is invoked&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; main&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;String&lt;/span&gt;&lt;/a&gt; args&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        AutoBoxing auto = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; AutoBoxing&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        auto.&lt;span class=&quot;me1&quot;&gt;testCompare&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        auto.&lt;span class=&quot;me1&quot;&gt;testOperator&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        auto.&lt;span class=&quot;me1&quot;&gt;testControl&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i = &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;;
        &lt;span class=&quot;co1&quot;&gt;// public void testMethod(Integer arg) wouldn&#039;t be invoked&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;//because  public void testMethod(double arg) will be invoked in JDK1.4&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;//Java tiger consider the backward capability&lt;/span&gt;
        auto.&lt;span class=&quot;me1&quot;&gt;testMethod&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        auto.&lt;span class=&quot;me1&quot;&gt;boxingDemo&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br/&gt;</description>
   <link>http://blueoxygen.dflying.net/3/archive/167_learn_java5_tiger_from_sample_codes_auto_boxing_and_unboxing.html</link>
      <pubDate>Thu, 22 Jun 2006 11:37:15 +0100</pubDate>   
  </item>
    <item>
   <title>Learn JAVA5 Tiger from sample codes: Enumerated</title>
   <description>&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;http://blueoxygen.dflying.net/plugins/plogeshi/styles/plogeshi.css&quot; /&gt;&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; enum User &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    Admin,User,Guest,Unknown   
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;

&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Login &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    
    &lt;span class=&quot;kw2&quot;&gt;private&lt;/span&gt; User user;
    EnumMap&amp;lt;User,String&amp;gt; userName = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; EnumMap&amp;lt;User, String&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;User.&lt;span class=&quot;me1&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;coMULTI&quot;&gt;/** Creates a new instance of Login */&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; Login&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        userName.&lt;span class=&quot;me1&quot;&gt;put&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;User.&lt;span class=&quot;me1&quot;&gt;Admin&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&quot;Administrator&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        userName.&lt;span class=&quot;me1&quot;&gt;put&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;User.&lt;span class=&quot;me1&quot;&gt;User&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&quot;David&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        userName.&lt;span class=&quot;me1&quot;&gt;put&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;User.&lt;span class=&quot;me1&quot;&gt;Guest&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&quot;Steve&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;boolean&lt;/span&gt; isAdmin&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;User user&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;user.&lt;span class=&quot;me1&quot;&gt;equals&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;User.&lt;span class=&quot;me1&quot;&gt;Admin&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            &lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;true&lt;/span&gt;;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
        &lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;false&lt;/span&gt;;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; printUserRole&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        User&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; users = user.&lt;span class=&quot;me1&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;User u : user.&lt;span class=&quot;me1&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;u.&lt;span class=&quot;me1&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; isRole&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;User user&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;switch&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;user&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; Admin:
                &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;admin&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
                &lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt;;
            &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; User:
                &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;User&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
                &lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt;;
            &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; Guest:
                &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;Guest&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
                &lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt;;
            default:
                &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;unknow&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; main&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;String&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; args&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        Login login = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Login&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;login.&lt;span class=&quot;me1&quot;&gt;isAdmin&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;User.&lt;span class=&quot;me1&quot;&gt;Admin&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        login.&lt;span class=&quot;me1&quot;&gt;printUserRole&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        login.&lt;span class=&quot;me1&quot;&gt;isRole&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;User.&lt;span class=&quot;me1&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br/&gt;</description>
   <link>http://blueoxygen.dflying.net/3/archive/166_learn_java5_tiger_from_sample_codes_enumerated.html</link>
      <pubDate>Thu, 22 Jun 2006 11:35:51 +0100</pubDate>   
  </item>
    <item>
   <title>Learn JAVA5 Tiger from sample codes: Generic</title>
   <description>&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;http://blueoxygen.dflying.net/plugins/plogeshi/styles/plogeshi.css&quot; /&gt;&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/**
 * public class Box&amp;lt;T extends Number&amp;gt;
 * @author david.duan
 */&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Box&amp;lt;T&amp;gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    
    &lt;span class=&quot;co1&quot;&gt;//you can&#039;t have a static variable such as protected static List&amp;lt;T&amp;gt; list...&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;protected&lt;/span&gt; List&amp;lt;T&amp;gt; contents;
    
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ABox+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Box&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        contents = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; ArrayList&amp;lt;T&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; getSize&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt; contents.&lt;span class=&quot;me1&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;boolean&lt;/span&gt; isEmpty&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;contents.&lt;span class=&quot;me1&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; == &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; add&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;T o&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        contents.&lt;span class=&quot;me1&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;o&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; T grab&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;!isEmpty&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            &lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt; contents.&lt;span class=&quot;me1&quot;&gt;remove&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt;
            &lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;null&lt;/span&gt;;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; main&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;String&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; args&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        Box&amp;lt;String&amp;gt; box = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; Box&amp;lt;String&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;co1&quot;&gt;//...&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
&lt;/br&gt;
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Generic &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    
    &lt;span class=&quot;coMULTI&quot;&gt;/** Creates a new instance of Generic */&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; Generic&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; collectionGeneric&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;//generic list&lt;/span&gt;
        List&amp;lt;String&amp;gt; onlyStrings = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; LinkedList&amp;lt;String&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        onlyStrings.&lt;span class=&quot;me1&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;Legal addition&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;co1&quot;&gt;//generic map&lt;/span&gt;
        Map&amp;lt;Integer, Integer&amp;gt; squares = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; HashMap&amp;lt;Integer, Integer&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i=&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;; i&amp;lt;&lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;; i++&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            squares.&lt;span class=&quot;me1&quot;&gt;put&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i, i*i&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i=&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;; i&amp;lt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;; i++&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; n = i*&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;;
            &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;The square of &quot;&lt;/span&gt; + n + &lt;span class=&quot;st0&quot;&gt;&quot; is &quot;&lt;/span&gt; + squares.&lt;span class=&quot;me1&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;n&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;//generic iterator&lt;/span&gt;
        List&amp;lt;String&amp;gt; listOfStrings = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; LinkedList&amp;lt;String&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        listOfStrings.&lt;span class=&quot;me1&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;Happy&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        listOfStrings.&lt;span class=&quot;me1&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;Birthday&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Iterator&amp;lt;String&amp;gt; i = listOfStrings.&lt;span class=&quot;me1&quot;&gt;iterator&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;; i.&lt;span class=&quot;me1&quot;&gt;hasNext&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;String&lt;/span&gt;&lt;/a&gt; s = i.&lt;span class=&quot;me1&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
            &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;//parameter generic&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; paramGeneric&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;List&amp;lt;String&amp;gt; list&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Iterator&amp;lt;String&amp;gt; i = list.&lt;span class=&quot;me1&quot;&gt;iterator&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;i.&lt;span class=&quot;me1&quot;&gt;hasNext&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;String&lt;/span&gt;&lt;/a&gt; s = i.&lt;span class=&quot;me1&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
            &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;//return generic&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; List&amp;lt;String&amp;gt; returnGeneric&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        List&amp;lt;String&amp;gt; list = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; LinkedList&amp;lt;String&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        list.&lt;span class=&quot;me1&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;string1&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt; list;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;//conversion&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; conversionGeneric&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        LinkedList&amp;lt;Float&amp;gt; floatList = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; LinkedList&amp;lt;Float&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        List&amp;lt;Float&amp;gt; moreFloats = floatList;
        &lt;span class=&quot;co1&quot;&gt;//illegal conversion LinkedList&amp;lt;Number&amp;gt; numberList = floatList;&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;//the way to resolve for backward capbility&lt;/span&gt;
        List&amp;lt;Integer&amp;gt; ints = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; LinkedList&amp;lt;Integer&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AList+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;List&lt;/span&gt;&lt;/a&gt; oldList = ints;
        List&amp;lt;Number&amp;gt; numList = oldList;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;//generic wildcard : this old plain way will generate unchecked warning&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; wildcardGeneric&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?q=allinurl%3AList+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;List&lt;/span&gt;&lt;/a&gt; list&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?q=allinurl%3AIterator+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Iterator&lt;/span&gt;&lt;/a&gt; i = list.&lt;span class=&quot;me1&quot;&gt;iterator&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;; i.&lt;span class=&quot;me1&quot;&gt;hasNext&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i.&lt;span class=&quot;me1&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;//generic wildcard&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; wildcardGeneric2&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;List&amp;lt;?&amp;gt; list&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;//you can&#039;t solve the problem by List&amp;lt;Object&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Iterator&amp;lt;?&amp;gt; i = list.&lt;span class=&quot;me1&quot;&gt;iterator&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;; i.&lt;span class=&quot;me1&quot;&gt;hasNext&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i.&lt;span class=&quot;me1&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br/&gt;</description>
   <link>http://blueoxygen.dflying.net/3/archive/165_learn_java5_tiger_from_sample_codes_generic.html</link>
      <pubDate>Tue, 20 Jun 2006 11:18:13 +0100</pubDate>   
  </item>
    <item>
   <title>JAVA5 Tiger sample codes:</title>
   <description>&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;http://blueoxygen.dflying.net/plugins/plogeshi/styles/plogeshi.css&quot; /&gt;&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; ar = &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;,&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;;
        &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; br = &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;,&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;;
        &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?q=allinurl%3AArrays+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Arrays&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;deepToString&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;ar&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;out&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?q=allinurl%3AArrays+java.sun.com&amp;bntl=1&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;Arrays&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;deepEquals&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;ar,br&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        StringBuilder sb = &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; StringBuilder&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;string builder&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/pre&gt;
&lt;p&gt;&lt;br/&gt;</description>
   <link>http://blueoxygen.dflying.net/3/archive/164_java5_tiger_sample_codes.html</link>
      <pubDate>Tue, 20 Jun 2006 09:21:13 +0100</pubDate>   
  </item>
    <item>
   <title>Drool-Business Logic Framework</title>
   <description>J2EE&amp;#24212;&amp;#29992;&amp;#26080;&amp;#38480;&amp;#21046;&amp;#30340;&amp;#20998;&amp;#23618;,&amp;#21508;&amp;#31181;&amp;#26694;&amp;#26550;&amp;#23618;&amp;#20986;&amp;#19981;&amp;#31351;&amp;#65292;&amp;#35774;&amp;#35745;&amp;#27169;&amp;#24335;&amp;#32463;&amp;#20037;&amp;#19981;&amp;#34928;&amp;#65292;&amp;#23601;&amp;#26159;&amp;#20026;&amp;#20102;&amp;#35774;&amp;#35745;&amp;#26356;&amp;#21512;&amp;#29702;&amp;#65292;&amp;#21512;&amp;#29702;&amp;#30340;&amp;#30446;&amp;#30340;&amp;#26159;&amp;#20026;&amp;#20102;&amp;#26494;&amp;#32806;&amp;#21512;&amp;#39640;&amp;#20869;&amp;#32858;&amp;#65292;&amp;#32780;&amp;#22823;&amp;#23478;&amp;#22312;&amp;#32463;&amp;#20856;&amp;#30340;J2EE3&amp;#23618;&amp;#26550;&amp;#26500;&amp;#20013;&amp;#65292;&amp;#25345;&amp;#20037;&amp;#23618; &amp;#34920;&amp;#31034;&amp;#23618; &amp;#19994;&amp;#21153;&amp;#36923;&amp;#36753;&amp;#23618;&amp;#20013;&amp;#65292;&amp;#34920;&amp;#31034;&amp;#23618;&amp;#19982;&amp;#19994;&amp;#21153;&amp;#36923;&amp;#36753;&amp;#23618;&amp;#30340;&amp;#20998;&amp;#31163;&amp;#20063;&amp;#26159;&amp;#35752;&amp;#35770;&amp;#24456;&amp;#22810;&amp;#65292;&amp;#23601;&amp;#26159;&amp;#20026;&amp;#20102;Business Logic&amp;#30340;&amp;#37325;&amp;#29992;&amp;#12290;&amp;#24456;&amp;#31616;&amp;#21333;&amp;#65292;&amp;#20320;&amp;#30340;&amp;#19994;&amp;#21153;&amp;#23618;&amp;#33021;&amp;#22815;&amp;#36866;&amp;#24212;Java Web Start&amp;#21644;Browser&amp;#20004;&amp;#31181;client&amp;#20040;&amp;#65311;&amp;#32780;&amp;#22240;&amp;#20026;&amp;#19994;&amp;#21153;&amp;#36923;&amp;#36753;&amp;#26159;&amp;#26680;&amp;#24515;&amp;#65292;&amp;#22914;&amp;#26524;&amp;#19981;&amp;#35299;&amp;#32806;&amp;#65292;&amp;#23427;&amp;#30340;&amp;#21464;&amp;#21270;&amp;#23558;&amp;#30452;&amp;#25509;&amp;#23548;&amp;#33268;&amp;#34920;&amp;#31034;&amp;#23618; &amp;#25345;&amp;#20037;&amp;#23618;&amp;#30340;&amp;#21464;&amp;#26356;&amp;#12290;&lt;br /&gt;&amp;#38271;&amp;#20037;&amp;#20197;&amp;#26469;&amp;#65292;&amp;#22823;&amp;#23478;&amp;#34429;&amp;#28982;&amp;#26368;&amp;#20851;&amp;#24515;&amp;#30340;&amp;#26159;&amp;#19994;&amp;#21153;&amp;#36923;&amp;#36753;&amp;#65292;&amp;#20294;&amp;#26159;&amp;#65292;&amp;#25345;&amp;#20037;&amp;#23618; &amp;#34920;&amp;#31034;&amp;#23618;&amp;#26694;&amp;#26550;&amp;#30830;&amp;#26159;&amp;#26368;&amp;#20016;&amp;#23500;&amp;#30340;&amp;#12290;&amp;#22823;&amp;#23478;&amp;#20284;&amp;#20046;&amp;#20064;&amp;#24815;&amp;#20110;&amp;#35753;&amp;#25216;&amp;#26415;&amp;#20154;&amp;#21592;&amp;#25110;&amp;#32773;&amp;#25317;&amp;#26377;&amp;#19994;&amp;#21153;&amp;#33021;&amp;#21147;&amp;#32972;&amp;#26223;&amp;#30340;&amp;#39640;&amp;#32423;&amp;#25216;&amp;#26415;&amp;#20154;&amp;#21592;&amp;#25343;&amp;#21040;&amp;#38656;&amp;#27714;&amp;#28982;&amp;#21518;&amp;#29992;JAVA code&amp;#26469;&amp;#25551;&amp;#36848;&amp;#37027;&amp;#22797;&amp;#26434;&amp;#22810;&amp;#21464;&amp;#30340;&amp;#19994;&amp;#21153;&amp;#36923;&amp;#36753;&amp;#12290;&amp;#34429;&amp;#28982;&amp;#30446;&amp;#21069;&amp;#20474;&amp;#24537;&amp;#20110;SAP,&amp;#20294;&amp;#26159;&amp;#23545;java&amp;#19968;&amp;#30452;&amp;#22312;&amp;#20851;&amp;#27880;&amp;#65292;&amp;#26368;&amp;#36817;&amp;#20174;&lt;a href=&quot;http://www.springside.org.cn&quot;&gt;SpringSide&lt;/a&gt;&amp;#20102;&amp;#35299;&amp;#21040;&amp;#20102;Drools&amp;#36825;&amp;#20010;&amp;#25105;Rule Engine&amp;#65292;&amp;#25105;&amp;#31216;&amp;#23427;&amp;#20026;Business Logic Framework. &amp;#22240;&amp;#20026;&amp;#23427;&amp;#20351;&amp;#29992;&amp;#38750;JAVA code &amp;#32780;&amp;#26159;DSL(Domain-Specific Language)&amp;#26469;&amp;#25551;&amp;#36848;&amp;#23481;&amp;#26131;&amp;#21464;&amp;#21270;&amp;#30340;&amp;#21830;&amp;#19994;&amp;#30340;&amp;#35268;&amp;#21017;&amp;#12290;&amp;#19981;&amp;#38656;&amp;#35201;&amp;#20887;&amp;#38271;&amp;#30340;java&amp;#20195;&amp;#30721;&amp;#65292;&amp;#19981;&amp;#38656;&amp;#35201;&amp;#21464;&amp;#26356;&amp;#21518;&amp;#30340;&amp;#32534;&amp;#35793; &amp;#25171;&amp;#21253; &amp;#37096;&amp;#32626;&amp;#12290;&amp;#35762;&amp;#21830;&amp;#19994;&amp;#35268;&amp;#21017;&amp;#25277;&amp;#21462;&amp;#20986;&amp;#26469;&amp;#65292;&amp;#21999;&amp;#65292;&amp;#20284;&amp;#20046;&amp;#26377;&amp;#25345;&amp;#20037;&amp;#23618;&amp;#37324;iBatis&amp;#30340;&amp;#21619;&amp;#36947;(SQL&amp;#25277;&amp;#21462;&amp;#20986;&amp;#26469;)&amp;#12290;&lt;br /&gt;&amp;#20197;&amp;#21069;&amp;#33609;&amp;#33609;&amp;#30340;&amp;#27983;&amp;#35272;&amp;#20102;&amp;#19968;&amp;#27425;Drool &amp;#37027;&amp;#20010;&amp;#26102;&amp;#20505;&amp;#26159;&amp;#29256;&amp;#26412;2&amp;#65292;&amp;#21830;&amp;#19994;&amp;#35268;&amp;#21017;&amp;#35201;&amp;#37197;&amp;#32622;&amp;#22312;XML&amp;#37324;&amp;#38754;&amp;#65292;&amp;#25105;&amp;#24863;&amp;#35273;&amp;#24456;&amp;#37057;&amp;#38391;&amp;#65292;&amp;#24456;&amp;#19981;&amp;#30452;&amp;#35266;&amp;#65292;&amp;#20063;&amp;#26377;&amp;#28857;&amp;#40635;&amp;#28902;&amp;#12290;Drool&amp;#34987;JBOSS&amp;#25910;&amp;#36141;&amp;#20197;&amp;#21518;&amp;#20135;&amp;#29983;&amp;#20102;&amp;#22823;&amp;#30340;&amp;#21464;&amp;#38761;&amp;#65292;&amp;#29616;&amp;#22312;Rule&amp;#20889;&amp;#36215;&amp;#26469;&amp;#23601;&amp;#20687;&amp;#19968;&amp;#31181;&amp;#33258;&amp;#28982;&amp;#35821;&amp;#35328;&amp;#19982;&amp;#35745;&amp;#31639;&amp;#26426;&amp;#33050;&amp;#26412;&amp;#35821;&amp;#35328;&amp;#30340;&amp;#32467;&amp;#21512;&amp;#65292;&amp;#24555;&amp;#25463;&amp;#65292;&amp;#26126;&amp;#20102;&amp;#12290;&lt;br /&gt;&amp;#24223;&amp;#35805;&amp;#19981;&amp;#22810;&amp;#20102;&amp;#65292;&amp;#22823;&amp;#23478;&amp;#20808;&amp;#30475;&amp;#19968;&amp;#30475;Drool&amp;#30340;&lt;a href=&quot;http://www.matrix.org.cn/resource/article/44/44046_Drools+Framework+Business.html&quot; target=&quot;_blank&quot;&gt;&amp;#20171;&amp;#32461;&lt;/a&gt;&amp;#65292;&amp;#36825;&amp;#20010;&amp;#20171;&amp;#32461;&amp;#26159;&amp;#38024;&amp;#23545;Drool2&amp;#30340;&amp;#65292;&amp;#19981;&amp;#36807;&amp;#21487;&amp;#20197;&amp;#30475;&amp;#20986;&amp;#26469;Drool&amp;#30340;&amp;#30446;&amp;#30340;&amp;#21644;&amp;#29992;&amp;#36884;&amp;#20102;&amp;#12290;&lt;br /&gt;&amp;#25105;&amp;#30340;&amp;#22909;&amp;#26379;&amp;#21451;&amp;#24046;&amp;#27801;&amp;#26368;&amp;#36817;&amp;#20063;&amp;#24320;&amp;#22987;&amp;#20889;blog&amp;#65292;&amp;#20182;&amp;#20171;&amp;#32461;&amp;#20102;&amp;#19968;&amp;#31687;&lt;a href=&quot;http://www.blogjava.net/sshwsfc/archive/2006/05/28/48622.html&quot; target=&quot;_blank&quot;&gt;Drool3&lt;/a&gt;&amp;#30340;&amp;#65292;&amp;#22823;&amp;#23478;&amp;#21487;&amp;#20197;&amp;#30475;&amp;#21040;Drool3&amp;#30340;&amp;#21464;&amp;#38761;&amp;#12290;&lt;br /&gt;&amp;#24744;&amp;#24212;&amp;#35813;&amp;#36843;&amp;#19981;&amp;#21450;&amp;#24453;&amp;#21435;&amp;#25226;&amp;#33258;&amp;#24049;&amp;#30340;&amp;#21830;&amp;#19994;&amp;#35268;&amp;#21017;&amp;#25277;&amp;#21462;&amp;#20986;&amp;#26469;&amp;#20102;&amp;#21543;……&lt;br/&gt;</description>
   <link>http://blueoxygen.dflying.net/3/archive/159_drool-business_logic_framework.html</link>
      <pubDate>Wed, 31 May 2006 11:37:18 +0100</pubDate>   
  </item>
    <item>
   <title>BIRT is a BOMB</title>
   <description>&lt;p&gt;BIRT is really a amazing report tool. It&#039;s so powerful and free.&lt;br /&gt;No more crap, just check this flash demo &lt;a href=&quot;http://download.eclipse.org/birt/downloads/examples/misc/BIRT/BIRT_demo_Camv3.html&quot;&gt;http://download.eclipse.org/birt/downloads/examples/misc/BIRT/BIRT_demo_Camv3.html&lt;/a&gt;&lt;/p&gt;&lt;br/&gt;</description>
   <link>http://blueoxygen.dflying.net/3/archive/158_birt_is_a_bomb.html</link>
      <pubDate>Mon, 29 May 2006 08:01:08 +0100</pubDate>   
  </item>
    <item>
   <title>SAP and JAVA Intergarion</title>
   <description>&lt;p&gt;I uploaded a document about SAP and JAVA&#039;s intergration.&lt;br /&gt;It introduce BAPI RFC ALE IDoc JCo&#039;s basic concept. Enjoy it.&lt;br /&gt;http://blueoxygen.dflying.net/3/resources/Java_SAP_Integration.pdf.html&lt;/p&gt;&lt;br/&gt;</description>
   <link>http://blueoxygen.dflying.net/3/archive/145_sap_and_java_intergarion.html</link>
      <pubDate>Tue, 16 May 2006 08:09:47 +0100</pubDate>   
  </item>
    <item>
   <title>The last reason to use NetBeans.</title>
   <description>&lt;p&gt;Recently,SUN publish Netbeans new release.Because project&#039;s requirement,I should use netbeans to design Swing UI. And at first,i really thought Netbeans Swing UI design tools pretty cool. But then i know,that&#039;s a vendor&#039;s production.Tody i got news from TheServerSide that the compony which design the Swing tools for SUN is supporting MyEclipse and i tried that.As convenience as it performed on NetBeans platform.&lt;br /&gt;
You can get a quic &lt;a href=&quot;http://myeclipseide.com/enterpriseworkbench/help/index.jsp?topic=/com.genuitec.eclipse.dehory.doc/doc/install/index.html&quot;&gt;start here.&lt;/a&gt;Good luck.&lt;/p&gt;
&lt;p&gt;Now the last reason to use NetBeans has gone.BTW,NetBeans default keymap really sucks!!! Ctrl+S means Search by default.The Netbeans designers are crazy??&lt;/p&gt;&lt;br/&gt;</description>
   <link>http://blueoxygen.dflying.net/3/archive/138_the_last_reason_to_use_netbeans.html</link>
      <pubDate>Sat, 29 Apr 2006 04:15:29 +0100</pubDate>   
  </item>
    <item>
   <title>Design Pattern--Creation Pattern</title>
   <description>&lt;img style=&quot;WIDTH: 433px; HEIGHT: 176px&quot; height=&quot;176&quot; hspace=&quot;0&quot; src=&quot;http://static.flickr.com/55/117223803_a1d04b47f2_o_d.jpg&quot; width=&quot;433&quot; align=&quot;baseline&quot; border=&quot;0&quot; /&gt;&lt;br/&gt;&lt;p class=&quot;MMTitle&quot; style=&quot;MARGIN: 12pt 0cm 3pt&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;font face=&quot;Arial&quot; size=&quot;5&quot;&gt;&lt;strong&gt;Creation Pattern&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MMTopic1&quot; style=&quot;MARGIN: 17pt 0cm 16.5pt; TEXT-INDENT: 0cm&quot;&gt;&lt;strong&gt;&lt;font size=&quot;6&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span&gt;1 &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Simple Factory(Static Factory)&lt;/span&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;A Factory Class generates Objects:&lt;br /&gt;public class ObjFactory{&lt;br /&gt;public static MyObjFactory(String which){&lt;br /&gt;if(which.equals(&amp;quot;obj1&amp;quot;&lt;img alt=&quot;;)&quot; src=&quot;http://www.dflying.net/plugins/smileys/icons/default/wink_smile.gif&quot; /&gt;){&lt;br /&gt;return new MyObj1();&lt;br /&gt;}else if(which.equals(&amp;quot;obj2&amp;quot;&lt;img alt=&quot;;)&quot; src=&quot;http://www.dflying.net/plugins/smileys/icons/default/wink_smile.gif&quot; /&gt;){&lt;br /&gt;return new MyObj2();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#32570;&amp;#28857;&amp;#65306;&amp;#24037;&amp;#21378;&amp;#31867;&amp;#22312;&amp;#22686;&amp;#21152;&amp;#26032;&amp;#30340;&amp;#23376;&amp;#31867;&amp;#30340;&amp;#26102;&amp;#20505;&amp;#38656;&amp;#35201;&amp;#20462;&amp;#25913;&amp;#12290;&amp;#22312;&amp;#31867;&amp;#30340;&amp;#23618;&amp;#27425;&amp;#20851;&amp;#31995;&amp;#22797;&amp;#26434;&amp;#30340;&amp;#26102;&amp;#20505;&amp;#24037;&amp;#21378;&amp;#31867;&amp;#30456;&amp;#24403;&amp;#33219;&amp;#32959;&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt; &lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#38590;&amp;#20110;&amp;#25193;&amp;#23637;&amp;#12290;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;showcase&lt;img alt=&quot;:D&quot; src=&quot;http://www.dflying.net/plugins/smileys/icons/default/teeth_smile.gif&quot; /&gt;ataFormat class of JDK&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#24037;&amp;#21378;&amp;#19981;&amp;#21333;&amp;#21333;&amp;#24635;&amp;#26159;&amp;#36820;&amp;#22238;&amp;#26032;&amp;#30340;&amp;#23545;&amp;#35937;&amp;#65292;&amp;#36824;&amp;#21487;&amp;#20197;&amp;#20869;&amp;#37096;&amp;#32500;&amp;#25252;&amp;#19968;&amp;#20010;&amp;#23545;&amp;#35937;&amp;#21015;&amp;#34920;&amp;#65292;&amp;#24490;&amp;#29615;&amp;#20351;&amp;#29992;&amp;#12290;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MMTopic1&quot; style=&quot;MARGIN: 17pt 0cm 16.5pt; TEXT-INDENT: 0cm&quot;&gt;&lt;strong&gt;&lt;font size=&quot;6&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span&gt;2 &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Factory&lt;/span&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#21019;&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#24314;&amp;#19968;&amp;#20010;&amp;#19982;&amp;#35201;&amp;#23454;&amp;#20363;&amp;#21270;&amp;#30340;&amp;#23545;&amp;#35937;&amp;#23618;&amp;#32423;&amp;#30456;&amp;#21516;&amp;#30340;&amp;#24037;&amp;#21378;&amp;#23618;&amp;#27425;&amp;#32467;&amp;#26500;&amp;#12290;&amp;#36890;&amp;#36807;&amp;#19981;&amp;#21516;&amp;#30340;&amp;#24037;&amp;#21378;&amp;#20135;&amp;#29983;&amp;#19981;&amp;#21516;&amp;#30340;&amp;#23545;&amp;#35937;&amp;#12290;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;public class Client{&lt;br /&gt;private static Creator creator1,creator2;&lt;br /&gt;private static Product prod1,prod2;&lt;br /&gt;public static void main(String[] args){&lt;br /&gt;creator1 = new Creator1();&lt;br /&gt;prod1 = creator1.factory();&lt;br /&gt;creator2 = new Creator1();&lt;br /&gt;prod2 = creator1.factory();&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;showcase:java.util.Collection iterator()&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MMTopic1&quot; style=&quot;MARGIN: 17pt 0cm 16.5pt; TEXT-INDENT: 0cm&quot;&gt;&lt;strong&gt;&lt;font size=&quot;6&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span&gt;3 &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Abstract Factory&lt;/span&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#24403;&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#26377;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;n&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#20010;&amp;#20135;&amp;#21697;&amp;#31561;&amp;#32423;&amp;#30340;&amp;#20135;&amp;#21697;&amp;#23545;&amp;#35937;&amp;#38656;&amp;#35201;&amp;#21019;&amp;#24314;&amp;#30340;&amp;#26102;&amp;#20505;&amp;#65292;&amp;#22914;&amp;#26524;&amp;#20351;&amp;#29992;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;Factory&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#27169;&amp;#24335;&amp;#24517;&amp;#28982;&amp;#38656;&amp;#35201;&amp;#21644;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;n&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#30456;&amp;#31561;&amp;#30340;&amp;#24037;&amp;#21378;&amp;#31561;&amp;#32423;&amp;#32467;&amp;#26500;&amp;#26469;&amp;#23545;&amp;#24212;&amp;#12290;&amp;#20294;&amp;#26159;&amp;#22914;&amp;#26524;&amp;#36825;&amp;#20960;&amp;#20010;&amp;#20135;&amp;#21697;&amp;#31561;&amp;#32423;&amp;#32467;&amp;#26500;&amp;#25317;&amp;#26377;&amp;#30456;&amp;#20284;&amp;#24615;&amp;#23601;&amp;#21487;&amp;#20197;&amp;#29992;&amp;#19968;&amp;#20010;&amp;#25277;&amp;#35937;&amp;#24037;&amp;#21378;&amp;#31561;&amp;#32423;&amp;#26469;&amp;#22788;&amp;#29702;&amp;#12290;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;public interface AbstractFactory{&lt;br /&gt;public ProductA factoryA();&lt;br /&gt;public ProductB factoryB();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class Factory1 implements AbstractFactory{&lt;br /&gt;public ProductA factoryA(){&lt;br /&gt;return new ProductA1();&lt;br /&gt;}&lt;br /&gt;public ProductB factoryA(){&lt;br /&gt;return new ProductB1();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;public class Factory2 implements AbstractFactory{&lt;br /&gt;public ProductA factoryA(){&lt;br /&gt;return new ProductA2();&lt;br /&gt;}&lt;br /&gt;public ProductB factoryA(){&lt;br /&gt;return new ProductB2();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Principle:&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#31995;&amp;#32479;&amp;#26377;&amp;#22810;&amp;#20110;&amp;#19968;&amp;#20010;&amp;#30340;&amp;#20135;&amp;#21697;&amp;#26063;&amp;#65292;&amp;#32780;&amp;#31995;&amp;#32479;&amp;#21482;&amp;#20351;&amp;#29992;&amp;#20854;&amp;#20013;&amp;#26576;&amp;#19968;&amp;#20010;&amp;#26063;&amp;#30340;&amp;#20135;&amp;#21697;&amp;#12290;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#21516;&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#23646;&amp;#20110;&amp;#19968;&amp;#26063;&amp;#30340;&amp;#20135;&amp;#21697;&amp;#24635;&amp;#26159;&amp;#22312;&amp;#19968;&amp;#36215;&amp;#20351;&amp;#29992;&amp;#12290;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;showcase:UI&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#32452;&amp;#20214;&amp;#24211;&amp;#12290;&amp;#22312;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;windows&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#19979;&amp;#20026;&amp;#19968;&amp;#26063;&amp;#65292;&amp;#22312;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;Linux&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#19979;&amp;#20026;&amp;#19968;&amp;#26063;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MMTopic1&quot; style=&quot;MARGIN: 17pt 0cm 16.5pt; TEXT-INDENT: 0cm&quot;&gt;&lt;strong&gt;&lt;font size=&quot;6&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span&gt;4 &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Singleton&lt;/span&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt 14.4pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Georgia&quot;&gt;Public class FrameFactory{&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt 14.4pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Georgia&quot;&gt;private static final frameInstance = new frame();&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt 14.4pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Georgia&quot;&gt;private FrameFactory(){}&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt 14.4pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Georgia&quot;&gt;public static Frame frame(){&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt 14.4pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Georgia&quot;&gt;return frameInstance;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt 14.4pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Georgia&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt 14.4pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Georgia&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt 14.4pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#22330;&amp;#26223;&amp;#65306;&amp;#31995;&amp;#32479;&amp;#35201;&amp;#27714;&amp;#27492;&amp;#31867;&amp;#21482;&amp;#26377;&amp;#19968;&amp;#20010;&amp;#23454;&amp;#20363;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MMTopic1&quot; style=&quot;MARGIN: 17pt 0cm 16.5pt; TEXT-INDENT: 0cm&quot;&gt;&lt;strong&gt;&lt;font size=&quot;6&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span&gt;5 &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Multition&lt;/span&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt 18.5pt; TEXT-INDENT: -18.75pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Symbol&quot;&gt;&lt;span&gt;·&lt;span style=&quot;FONT-WEIGHT: normal; FONT-SIZE: 7pt; LINE-HEIGHT: normal; FONT-STYLE: normal; FONT-VARIANT: normal&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#22810;&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#20363;&amp;#31867;&amp;#21487;&amp;#20197;&amp;#26377;&amp;#22810;&amp;#20010;&amp;#23454;&amp;#20363;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt 18.5pt; TEXT-INDENT: -18.75pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Symbol&quot;&gt;&lt;span&gt;·&lt;span style=&quot;FONT-WEIGHT: normal; FONT-SIZE: 7pt; LINE-HEIGHT: normal; FONT-STYLE: normal; FONT-VARIANT: normal&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#22810;&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#20363;&amp;#31867;&amp;#24517;&amp;#39035;&amp;#33258;&amp;#24049;&amp;#21019;&amp;#24314;&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt; &lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#31649;&amp;#29702;&amp;#33258;&amp;#24049;&amp;#30340;&amp;#23454;&amp;#20363;&amp;#65292;&amp;#24182;&amp;#21521;&amp;#22806;&amp;#25552;&amp;#20379;&amp;#33258;&amp;#24049;&amp;#30340;&amp;#23454;&amp;#20363;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#23454;&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#20363;&amp;#25968;&amp;#30446;&amp;#26377;&amp;#19978;&amp;#38480;&amp;#30340;&amp;#21483;&amp;#20570;&amp;#26377;&amp;#19978;&amp;#38480;&amp;#22810;&amp;#20363;&amp;#31867;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;public class Die{&lt;br /&gt;private static Die die1 = new Die();&lt;br /&gt;private static Die die2 = new Die();&lt;br /&gt;private Die(){}&lt;br /&gt;public static Die getInstance(int whichOne){&lt;br /&gt;if(whichOne ==1) return die1;&lt;br /&gt;else return die2;&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;public synchronized int dice(){&lt;br /&gt;//....service method&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#24403;&amp;#23454;&amp;#20363;&amp;#20010;&amp;#25968;&amp;#24456;&amp;#22810;&amp;#30340;&amp;#26102;&amp;#20505;&amp;#38656;&amp;#35201;&amp;#32858;&amp;#21512;&amp;#31649;&amp;#29702;&amp;#65292;&amp;#27604;&amp;#22914;&amp;#29992;&amp;#19968;&amp;#20010;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;HashMap&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#26469;&amp;#31649;&amp;#29702;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;instance&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MMTopic1&quot; style=&quot;MARGIN: 17pt 0cm 16.5pt; TEXT-INDENT: 0cm&quot;&gt;&lt;strong&gt;&lt;font size=&quot;6&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span&gt;6 &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Builder&lt;/span&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#24314;&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#36896;&amp;#27169;&amp;#24335;&amp;#21487;&amp;#20197;&amp;#23558;&amp;#19968;&amp;#20010;&amp;#20135;&amp;#21697;&amp;#30340;&amp;#20869;&amp;#37096;&amp;#34920;&amp;#35937;&amp;#21644;&amp;#20135;&amp;#21697;&amp;#30340;&amp;#29983;&amp;#20135;&amp;#36807;&amp;#31243;&amp;#20998;&amp;#21106;&amp;#24320;&amp;#65292;&amp;#20174;&amp;#32780;&amp;#21487;&amp;#20197;&amp;#20351;&amp;#19968;&amp;#20010;&amp;#24314;&amp;#36896;&amp;#36807;&amp;#31243;&amp;#29983;&amp;#25104;&amp;#20855;&amp;#26377;&amp;#19981;&amp;#21516;&amp;#20869;&amp;#37096;&amp;#34920;&amp;#35937;&amp;#30340;&amp;#20135;&amp;#21697;&amp;#23545;&amp;#35937;&amp;#12290;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;public class Director{&lt;br /&gt;private Builder builder;&lt;br /&gt;public void construct(){&lt;br /&gt;builder = new ConcreteBuilder();&lt;br /&gt;builder.buildPart1();&lt;br /&gt;builder.buildPart2();&lt;br /&gt;builder.retrieveResult();&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;abstract public class Builder{&lt;br /&gt;public abstract void buildPart1();&lt;br /&gt;public abstract void buildPart2();&lt;br /&gt;public abstract void retrieveResult();&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;public class ConcreteBuilder extends Builder{&lt;br /&gt;private Product product = new Product();&lt;br /&gt;public Product retrieveResult(){&lt;br /&gt;return product;&lt;br /&gt;}&lt;br /&gt;public void buildPart1(){&lt;br /&gt;//build first part of product&lt;br /&gt;}&lt;br /&gt;public void buildPart2(){&lt;br /&gt;//build second part of product&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt&quot;&gt;&lt;b&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#30465;&amp;#30053;&amp;#23548;&amp;#28436;&amp;#32773;&amp;#21644;&amp;#25277;&amp;#35937;&amp;#24314;&amp;#36896;&amp;#32773;&amp;#23545;&amp;#35937;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;public class Builder{&lt;br /&gt;private Product product = new Product();&lt;br /&gt;public void buildPart1(){&lt;br /&gt;//build part1&lt;br /&gt;}&lt;br /&gt;public void buildPart2(){&lt;br /&gt;//build part2&lt;br /&gt;}&lt;br /&gt;public Product retriveResult(){&lt;br /&gt;return product;&lt;br /&gt;}&lt;br /&gt;public void construct(){&lt;br /&gt;buildPart1();&lt;br /&gt;buildPart2();&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;public class Client{&lt;br /&gt;private static Builder builder;&lt;br /&gt;static public void main(){&lt;br /&gt;builder = new Builer();&lt;br /&gt;builder.construct();&lt;br /&gt;Product product = builder.retrieveResult();&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt 18.5pt; TEXT-INDENT: -18.75pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Symbol&quot;&gt;&lt;span&gt;·&lt;span style=&quot;FONT-WEIGHT: normal; FONT-SIZE: 7pt; LINE-HEIGHT: normal; FONT-STYLE: normal; FONT-VARIANT: normal&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;Builder&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#27169;&amp;#24335;&amp;#21487;&amp;#20197;&amp;#36864;&amp;#21270;&amp;#20026;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;Templete&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#27169;&amp;#24335;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt 18.5pt; TEXT-INDENT: -18.75pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Symbol&quot;&gt;&lt;span&gt;·&lt;span style=&quot;FONT-WEIGHT: normal; FONT-SIZE: 7pt; LINE-HEIGHT: normal; FONT-STYLE: normal; FONT-VARIANT: normal&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#21487;&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#20197;&amp;#23558;&amp;#20135;&amp;#21697;&amp;#21644;&amp;#20135;&amp;#21697;&amp;#30340;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;Builder&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#31867;&amp;#21512;&amp;#20108;&amp;#20026;&amp;#19968;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt 18.5pt; TEXT-INDENT: -18.75pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Symbol&quot;&gt;&lt;span&gt;·&lt;span style=&quot;FONT-WEIGHT: normal; FONT-SIZE: 7pt; LINE-HEIGHT: normal; FONT-STYLE: normal; FONT-VARIANT: normal&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;Builder&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#27169;&amp;#24335;&amp;#19982;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;Abstract Factory&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#27169;&amp;#24335;&amp;#30340;&amp;#21306;&amp;#21035;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt 18.5pt; TEXT-INDENT: -18.75pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Symbol&quot;&gt;&lt;span&gt;·&lt;span style=&quot;FONT-WEIGHT: normal; FONT-SIZE: 7pt; LINE-HEIGHT: normal; FONT-STYLE: normal; FONT-VARIANT: normal&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;JavaMail&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#20013;&amp;#20351;&amp;#29992;&amp;#20102;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;Builder&lt;/span&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &amp;#23435;&amp;#20307;&quot;&gt;&amp;#27169;&amp;#24335;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;--Message MimeMessage class&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN: 2.8pt 0cm 5.65pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;&gt;String smtpHost = &amp;quot;smtp.mycompany.com&amp;quot;;&lt;br /&gt;String from = &amp;quot;david@mycompany.com&amp;quot;;&lt;br /&gt;String to = &amp;quot;nihao@be.com&amp;quot;;&lt;br /&gt;Properties prps = new Properties();&lt;br /&gt;props.put(&amp;quot;mail.smtp.host&amp;quot;,smtpHost);&lt;br /&gt;Session session = Session.getDefaultInstance(props,null);&lt;br /&gt;InternetAddress[] address = {new InternetAddress(to)};&lt;br /&gt;message = new MimeMessage(session);&lt;br /&gt;message.setFrom(new InternetAddress(from));&lt;br /&gt;message.setRecipients(Message.RecipientType.TO,address);&lt;br /&gt;message.setSubject...&lt;br /&gt;message.setSendDate...&lt;br /&gt;message.setText...&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MMTopic1&quot; style=&quot;MARGIN: 17pt 0cm 16.5pt; TEXT-INDENT: 0cm&quot;&gt;&lt;strong&gt;&lt;font size=&quot;6&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span&gt;7 &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Prototype&lt;/span&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p /&gt;</description>
   <link>http://blueoxygen.dflying.net/3/archive/95_design_pattern--creation_pattern.html</link>
      <pubDate>Fri, 24 Mar 2006 15:50:45 +0000</pubDate>   
  </item>
  </rdf:RDF>

