<?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 Polymorphism and Overriding Methods</title>
	<atom:link href="http://unitstep.net/blog/2009/02/13/java-polymorphism-and-overriding-methods/feed/" rel="self" type="application/rss+xml" />
	<link>http://unitstep.net/blog/2009/02/13/java-polymorphism-and-overriding-methods/</link>
	<description>the home of peter chng</description>
	<lastBuildDate>Sun, 05 Feb 2012 23:06:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: rar</title>
		<link>http://unitstep.net/blog/2009/02/13/java-polymorphism-and-overriding-methods/comment-page-1/#comment-194349</link>
		<dc:creator>rar</dc:creator>
		<pubDate>Wed, 09 Jun 2010 04:58:30 +0000</pubDate>
		<guid isPermaLink="false">http://unitstep.net/?p=600#comment-194349</guid>
		<description>pak u kaung lahat</description>
		<content:encoded><![CDATA[<p>pak u kaung lahat</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dario</title>
		<link>http://unitstep.net/blog/2009/02/13/java-polymorphism-and-overriding-methods/comment-page-1/#comment-174728</link>
		<dc:creator>Dario</dc:creator>
		<pubDate>Tue, 03 Nov 2009 12:30:25 +0000</pubDate>
		<guid isPermaLink="false">http://unitstep.net/?p=600#comment-174728</guid>
		<description>What if the static method needs to be called from inside the father class? like this:

public static class A {
  public static String getStaticName () {
     return getStaticNameP();
  }
		
  protected static String getStaticNameP() {
    return &quot;Statically A!&quot;;
  }
}

public static class B extends A {
  public static String getStaticNameP() {
    return &quot;Statically B!&quot;;
  }
		
  public static void main( String[] args ) {
    System.out.println(B.getStaticName());
  }
}

the output of this code is &quot;Statically A!&quot;
Imagine the public method is a save method you don&#039;t want to override in the subclasses because it works just fine, but the filepath is class dependant (thus, a static method)</description>
		<content:encoded><![CDATA[<p>What if the static method needs to be called from inside the father class? like this:</p>
<p>public static class A {<br />
  public static String getStaticName () {<br />
     return getStaticNameP();<br />
  }</p>
<p>  protected static String getStaticNameP() {<br />
    return &#8220;Statically A!&#8221;;<br />
  }<br />
}</p>
<p>public static class B extends A {<br />
  public static String getStaticNameP() {<br />
    return &#8220;Statically B!&#8221;;<br />
  }</p>
<p>  public static void main( String[] args ) {<br />
    System.out.println(B.getStaticName());<br />
  }<br />
}</p>
<p>the output of this code is &#8220;Statically A!&#8221;<br />
Imagine the public method is a save method you don&#8217;t want to override in the subclasses because it works just fine, but the filepath is class dependant (thus, a static method)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anuradha</title>
		<link>http://unitstep.net/blog/2009/02/13/java-polymorphism-and-overriding-methods/comment-page-1/#comment-156576</link>
		<dc:creator>Anuradha</dc:creator>
		<pubDate>Thu, 16 Apr 2009 10:08:05 +0000</pubDate>
		<guid isPermaLink="false">http://unitstep.net/?p=600#comment-156576</guid>
		<description>Hi,
   It was a wonderful and shot but very imp inormation.

Thanks</description>
		<content:encoded><![CDATA[<p>Hi,<br />
   It was a wonderful and shot but very imp inormation.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>

