<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Java Trivia</title>
	<atom:link href="http://blog.tmorris.net/java-trivia/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tmorris.net/java-trivia/</link>
	<description>The weblog of Tony Morris</description>
	<pubDate>Sat, 19 May 2012 02:52:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: λ Tony’s blog λ &#187; Blog Archive &#187; Optional -&#62; a (negative proof)</title>
		<link>http://blog.tmorris.net/java-trivia/#comment-42085</link>
		<dc:creator>λ Tony’s blog λ &#187; Blog Archive &#187; Optional -&#62; a (negative proof)</dc:creator>
		<pubDate>Sun, 20 Jun 2010 03:57:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/?p=771#comment-42085</guid>
		<description>[...] λ Tony’s blog λ The weblog of Tony Morris      &#171; Java Trivia [...]</description>
		<content:encoded><![CDATA[<p>[...] λ Tony’s blog λ The weblog of Tony Morris      &laquo; Java Trivia [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Berlin Brown</title>
		<link>http://blog.tmorris.net/java-trivia/#comment-41778</link>
		<dc:creator>Berlin Brown</dc:creator>
		<pubDate>Sat, 12 Jun 2010 06:11:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/?p=771#comment-41778</guid>
		<description>Also, keep the Java posts coming for those of us that haven't completely moved to Scala.</description>
		<content:encoded><![CDATA[<p>Also, keep the Java posts coming for those of us that haven&#8217;t completely moved to Scala.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Berlin Brown</title>
		<link>http://blog.tmorris.net/java-trivia/#comment-41776</link>
		<dc:creator>Berlin Brown</dc:creator>
		<pubDate>Sat, 12 Jun 2010 05:32:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/?p=771#comment-41776</guid>
		<description>I don't know why I found this so interesting but I did and wrote a verbose impl.

So, like Bas, use anony innner-class impl.  I didn't see that immediately

https://doingitwrongnotebook.googlecode.com/svn/trunk/doingitwrong_phase1/src/java/src/org/berlin/tonyblog/Trivia1.java

Here is an example test case, don't know if that is the intended purpose or not.

 public static void test2() {
        System.out.println("Trivia 2 - return Function&lt;A&gt;");        
        final Function[Integer, Integer] f_ab = new Function[Integer, Integer]() {            
                                               
            @Override
            public Integer apply(Integer a) {                
                return a * 2;
            }                        
        }; // End of Anon a-b
        
        final Function[Integer, Integer] g_bc = new Function[Integer, Integer]() {            
            @Override
            public Integer apply(Integer b) {                
                return b * 3;
            }            
        }; // End of Anon a-b  
        
        System.out.println("Result: " + c(f_ab, g_bc).apply(10));   
    }  


----

Output is 60.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t know why I found this so interesting but I did and wrote a verbose impl.</p>
<p>So, like Bas, use anony innner-class impl.  I didn&#8217;t see that immediately</p>
<p><a href="https://doingitwrongnotebook.googlecode.com/svn/trunk/doingitwrong_phase1/src/java/src/org/berlin/tonyblog/Trivia1.java" onclick="javascript:pageTracker._trackPageview('/outbound/comment/doingitwrongnotebook.googlecode.com');" rel="nofollow">https://doingitwrongnotebook.googlecode.com/svn/trunk/doingitwrong_phase1/src/java/src/org/berlin/tonyblog/Trivia1.java</a></p>
<p>Here is an example test case, don&#8217;t know if that is the intended purpose or not.</p>
<p> public static void test2() {<br />
        System.out.println(&#8221;Trivia 2 - return Function<a>&#8220;);<br />
        final Function[Integer, Integer] f_ab = new Function[Integer, Integer]() {            </p>
<p>            @Override<br />
            public Integer apply(Integer a) {<br />
                return a * 2;<br />
            }<br />
        }; // End of Anon a-b</p>
<p>        final Function[Integer, Integer] g_bc = new Function[Integer, Integer]() {<br />
            @Override<br />
            public Integer apply(Integer b) {<br />
                return b * 3;<br />
            }<br />
        }; // End of Anon a-b  </p>
<p>        System.out.println(&#8221;Result: &#8221; + c(f_ab, g_bc).apply(10));<br />
    }  </p>
<p>&#8212;-</p>
<p>Output is 60.</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony Morris</title>
		<link>http://blog.tmorris.net/java-trivia/#comment-41750</link>
		<dc:creator>Tony Morris</dc:creator>
		<pubDate>Fri, 11 Jun 2010 10:52:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/?p=771#comment-41750</guid>
		<description>Yes, this is true Ricky. I had clarified the rules. Sorry for the confusion.</description>
		<content:encoded><![CDATA[<p>Yes, this is true Ricky. I had clarified the rules. Sorry for the confusion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricky Clarkson</title>
		<link>http://blog.tmorris.net/java-trivia/#comment-41720</link>
		<dc:creator>Ricky Clarkson</dc:creator>
		<pubDate>Thu, 10 Jun 2010 20:24:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/?p=771#comment-41720</guid>
		<description>No, type-casting *is* disallowed in the rules, but wasn't at the time I wrote my comment.</description>
		<content:encoded><![CDATA[<p>No, type-casting *is* disallowed in the rules, but wasn&#8217;t at the time I wrote my comment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://blog.tmorris.net/java-trivia/#comment-41605</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Thu, 10 Jun 2010 07:01:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/?p=771#comment-41605</guid>
		<description>Ricky: casting was disallowed in the rules :)</description>
		<content:encoded><![CDATA[<p>Ricky: casting was disallowed in the rules <img src='http://blog.tmorris.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricky Clarkson</title>
		<link>http://blog.tmorris.net/java-trivia/#comment-41341</link>
		<dc:creator>Ricky Clarkson</dc:creator>
		<pubDate>Fri, 04 Jun 2010 09:58:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/?p=771#comment-41341</guid>
		<description>In case it's not obvious, I'd just like to point out that my answer was a joke, though a joke that will compile and will sometimes work at runtime.  It gives a compile warning.</description>
		<content:encoded><![CDATA[<p>In case it&#8217;s not obvious, I&#8217;d just like to point out that my answer was a joke, though a joke that will compile and will sometimes work at runtime.  It gives a compile warning.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim</title>
		<link>http://blog.tmorris.net/java-trivia/#comment-41253</link>
		<dc:creator>Jim</dc:creator>
		<pubDate>Wed, 02 Jun 2010 13:52:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/?p=771#comment-41253</guid>
		<description>Am I missing something?  

I feel I must be, b/c while I still haven't been able to work myself through 'Beginner Java Exercise with Data Types' in 20 minutes, it took me about 10 seconds to independently come up with the solution Andrey posted above.</description>
		<content:encoded><![CDATA[<p>Am I missing something?  </p>
<p>I feel I must be, b/c while I still haven&#8217;t been able to work myself through &#8216;Beginner Java Exercise with Data Types&#8217; in 20 minutes, it took me about 10 seconds to independently come up with the solution Andrey posted above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ionut G. Stan</title>
		<link>http://blog.tmorris.net/java-trivia/#comment-41244</link>
		<dc:creator>Ionut G. Stan</dc:creator>
		<pubDate>Wed, 02 Jun 2010 08:26:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/?p=771#comment-41244</guid>
		<description>Is there any reason for which my answer doesn't get moderated?</description>
		<content:encoded><![CDATA[<p>Is there any reason for which my answer doesn&#8217;t get moderated?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrey Vityuk</title>
		<link>http://blog.tmorris.net/java-trivia/#comment-41241</link>
		<dc:creator>Andrey Vityuk</dc:creator>
		<pubDate>Wed, 02 Jun 2010 06:56:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/?p=771#comment-41241</guid>
		<description>Sorry, generics escaped...
return new Function&lt;A&gt;() {
&#160;&#160;&#160;public C apply(A a) {
&#160;&#160;&#160;&#160;&#160;&#160;return g.apply(f.apply(a));
&#160;&#160;&#160;}
};</description>
		<content:encoded><![CDATA[<p>Sorry, generics escaped&#8230;<br />
return new Function<a>() {<br />
&nbsp;&nbsp;&nbsp;public C apply(A a) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return g.apply(f.apply(a));<br />
&nbsp;&nbsp;&nbsp;}<br />
};</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

