<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Java Generics: Instantiating Objects Of Type Parameter Without Passing Class Literal To Instance</title>
	<atom:link href="http:///ser/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/feed" rel="self" type="application/rss+xml" />
	<link>/ser/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal</link>
	<description>about searching</description>
	<lastBuildDate>Wed, 01 Feb 2012 21:00:28 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Pim</title>
		<link>/ser/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/comment-page-1#comment-3701</link>
		<dc:creator>Pim</dc:creator>
		<pubDate>Mon, 14 Feb 2011 10:19:04 +0000</pubDate>
		<guid isPermaLink="false">/ser/index.php/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/#comment-3701</guid>
		<description>html... :(
Nice solution.
Though I don’t get one thing.
If I have a generic container FooContainer[C] of Foo[T].
Where [C] is in fact Foo[T].
How can FooContainer create an instance of [C]?</description>
		<content:encoded><![CDATA[<p>html&#8230; :(<br />
Nice solution.<br />
Though I don’t get one thing.<br />
If I have a generic container FooContainer[C] of Foo[T].<br />
Where [C] is in fact Foo[T].<br />
How can FooContainer create an instance of [C]?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pim</title>
		<link>/ser/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/comment-page-1#comment-3700</link>
		<dc:creator>Pim</dc:creator>
		<pubDate>Mon, 14 Feb 2011 10:18:14 +0000</pubDate>
		<guid isPermaLink="false">/ser/index.php/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/#comment-3700</guid>
		<description>Nice solution.
Though I don’t get one thing.
If I have a generic container FooContainer of Foo.
Where is in fact Foo.
How can FooContainer create an instance of ?</description>
		<content:encoded><![CDATA[<p>Nice solution.<br />
Though I don’t get one thing.<br />
If I have a generic container FooContainer of Foo.<br />
Where is in fact Foo.<br />
How can FooContainer create an instance of ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pim</title>
		<link>/ser/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/comment-page-1#comment-3699</link>
		<dc:creator>Pim</dc:creator>
		<pubDate>Mon, 14 Feb 2011 10:15:57 +0000</pubDate>
		<guid isPermaLink="false">/ser/index.php/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/#comment-3699</guid>
		<description>Nice solution.
Though I don&#039;t get one thing.
If I have a generic container FooContainer of Foo.
Where  is in fact Foo.
How can FooContainer create an instance of ?</description>
		<content:encoded><![CDATA[<p>Nice solution.<br />
Though I don&#8217;t get one thing.<br />
If I have a generic container FooContainer of Foo.<br />
Where  is in fact Foo.<br />
How can FooContainer create an instance of ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: travelar</title>
		<link>/ser/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/comment-page-1#comment-3698</link>
		<dc:creator>travelar</dc:creator>
		<pubDate>Fri, 24 Dec 2010 12:05:38 +0000</pubDate>
		<guid isPermaLink="false">/ser/index.php/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/#comment-3698</guid>
		<description>&quot;Fortunately, you can avoid such ugly code in some situations. In case where your class is a subclass of fully parameterized type you could get classes of actual type arguments using the Reflect API.&quot;
How much is real?</description>
		<content:encoded><![CDATA[<p>&#8220;Fortunately, you can avoid such ugly code in some situations. In case where your class is a subclass of fully parameterized type you could get classes of actual type arguments using the Reflect API.&#8221;<br />
How much is real?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seweryn Niemiec</title>
		<link>/ser/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/comment-page-1#comment-1314</link>
		<dc:creator>Seweryn Niemiec</dc:creator>
		<pubDate>Thu, 07 Feb 2008 11:07:55 +0000</pubDate>
		<guid isPermaLink="false">/ser/index.php/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/#comment-1314</guid>
		<description>thx for all comments. 
btw, I have fixed some formatting issues which arouse with new web template.</description>
		<content:encoded><![CDATA[<p>thx for all comments.<br />
btw, I have fixed some formatting issues which arouse with new web template.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Miller</title>
		<link>/ser/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/comment-page-1#comment-5</link>
		<dc:creator>Alex Miller</dc:creator>
		<pubDate>Mon, 26 Mar 2007 12:53:04 +0000</pubDate>
		<guid isPermaLink="false">/ser/index.php/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/#comment-5</guid>
		<description>Yeah, reified generics hopefully will be part of Java 7 - see http://tech.puredanger.com/java7#reified for some more info.</description>
		<content:encoded><![CDATA[<p>Yeah, reified generics hopefully will be part of Java 7 &#8211; see <a href="http://tech.puredanger.com/java7#reified" rel="nofollow">http://tech.puredanger.com/java7#reified</a> for some more info.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seweryn Niemiec</title>
		<link>/ser/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/comment-page-1#comment-4</link>
		<dc:creator>Seweryn Niemiec</dc:creator>
		<pubDate>Mon, 26 Mar 2007 10:30:11 +0000</pubDate>
		<guid isPermaLink="false">/ser/index.php/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/#comment-4</guid>
		<description>We have to wait for Java 7 for that.</description>
		<content:encoded><![CDATA[<p>We have to wait for Java 7 for that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>/ser/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/comment-page-1#comment-3</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Mon, 26 Mar 2007 09:40:22 +0000</pubDate>
		<guid isPermaLink="false">/ser/index.php/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/#comment-3</guid>
		<description>You should really be able to do T.getClass()</description>
		<content:encoded><![CDATA[<p>You should really be able to do T.getClass()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricky Clarkson</title>
		<link>/ser/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/comment-page-1#comment-2</link>
		<dc:creator>Ricky Clarkson</dc:creator>
		<pubDate>Sun, 25 Mar 2007 15:10:29 +0000</pubDate>
		<guid isPermaLink="false">/ser/index.php/2007/03/25/java-generics-instantiating-objects-of-type-parameter-without-using-class-literal/#comment-2</guid>
		<description>A better way is to require a general Factory, which is what a Constructor would be if it wasn&#039;t so tightly bound to the implementation of objects/classes in Java.

Then you just take a generic Factory, and call newInstance.

public [T] void doSomething(Factory[T] factory)
{
    T t=factory.newInstance();
    t.stuff();
}

I used [] to avoid HTML swallowing, as there&#039;s no Preview button.</description>
		<content:encoded><![CDATA[<p>A better way is to require a general Factory, which is what a Constructor would be if it wasn&#8217;t so tightly bound to the implementation of objects/classes in Java.</p>
<p>Then you just take a generic Factory, and call newInstance.</p>
<p>public [T] void doSomething(Factory[T] factory)<br />
{<br />
    T t=factory.newInstance();<br />
    t.stuff();<br />
}</p>
<p>I used [] to avoid HTML swallowing, as there&#8217;s no Preview button.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

