<?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: C# vs Java: casting objects and calling members</title>
	<atom:link href="http://blog.cyragon.com/2011/02/c-vs-java-casting-objects-and-calling-members/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.cyragon.com/2011/02/c-vs-java-casting-objects-and-calling-members/</link>
	<description>where it all begins</description>
	<lastBuildDate>Wed, 23 Feb 2011 03:40:47 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
	<item>
		<title>By: xoran_tc</title>
		<link>http://blog.cyragon.com/2011/02/c-vs-java-casting-objects-and-calling-members/comment-page-1/#comment-42776</link>
		<dc:creator>xoran_tc</dc:creator>
		<pubDate>Wed, 23 Feb 2011 03:40:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cyragon.com/?p=210#comment-42776</guid>
		<description>Sorry, this is turning into a spam fest... In class A you would also need to mark the Method() as virtual (abstract requires no code and you have code).

  I know this seems like overkill.  You can read up on some of the reasoning here:
http://codeword.blogspot.com/2003/12/polymorphism-c-vs-java-vs-c.html</description>
		<content:encoded><![CDATA[<p>Sorry, this is turning into a spam fest&#8230; In class A you would also need to mark the Method() as virtual (abstract requires no code and you have code).</p>
<p>  I know this seems like overkill.  You can read up on some of the reasoning here:<br />
<a href="http://codeword.blogspot.com/2003/12/polymorphism-c-vs-java-vs-c.html" rel="nofollow">http://codeword.blogspot.com/2003/12/polymorphism-c-vs-java-vs-c.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xoran_tc</title>
		<link>http://blog.cyragon.com/2011/02/c-vs-java-casting-objects-and-calling-members/comment-page-1/#comment-42775</link>
		<dc:creator>xoran_tc</dc:creator>
		<pubDate>Wed, 23 Feb 2011 03:34:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cyragon.com/?p=210#comment-42775</guid>
		<description>Oops sorry, I hijacked the Java example.  Here&#039;s what I really wanted to do (using the C# example):

public class B : A
{
  public override String Method()
  {
    return &quot;this is B&quot;;
  }
}</description>
		<content:encoded><![CDATA[<p>Oops sorry, I hijacked the Java example.  Here&#8217;s what I really wanted to do (using the C# example):</p>
<p>public class B : A<br />
{<br />
  public override String Method()<br />
  {<br />
    return &#8220;this is B&#8221;;<br />
  }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xoran_tc</title>
		<link>http://blog.cyragon.com/2011/02/c-vs-java-casting-objects-and-calling-members/comment-page-1/#comment-42774</link>
		<dc:creator>xoran_tc</dc:creator>
		<pubDate>Wed, 23 Feb 2011 03:33:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cyragon.com/?p=210#comment-42774</guid>
		<description>No, it&#039;s not a type issue.  In C#, to override a method of the parent class requires that you specify the modifier &quot;override&quot;.  So, class B should look like this (note the &quot;override&quot; before &quot;String Method()&quot;:

public class B extends A
{
  public override String Method()
  {
    return &quot;this is B&quot;;
  }
}

  The reason for this difference is that the designer(s) of C# wanted polymorphism to be more explicit (I believe).</description>
		<content:encoded><![CDATA[<p>No, it&#8217;s not a type issue.  In C#, to override a method of the parent class requires that you specify the modifier &#8220;override&#8221;.  So, class B should look like this (note the &#8220;override&#8221; before &#8220;String Method()&#8221;:</p>
<p>public class B extends A<br />
{<br />
  public override String Method()<br />
  {<br />
    return &#8220;this is B&#8221;;<br />
  }<br />
}</p>
<p>  The reason for this difference is that the designer(s) of C# wanted polymorphism to be more explicit (I believe).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
