<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>polymorphism in java | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/polymorphism-in-java/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sun, 04 Oct 2009 16:16:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>Java program that illustrates how run time polymorphism is achieved</title>
		<link>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-that-illustrates-how-run-time-polymorphism-is-achieved/</link>
					<comments>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-that-illustrates-how-run-time-polymorphism-is-achieved/#respond</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sun, 04 Oct 2009 16:16:01 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[Java codes]]></category>
		<category><![CDATA[Java program]]></category>
		<category><![CDATA[run time polymorphism]]></category>
		<category><![CDATA[polymorphism in java]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=904</guid>

					<description><![CDATA[<p>figure f=new figure(45,6);<br />
		rectangle r=new rectangle(10,30);<br />
		triangle t=new triangle(10,20);<br />
		figure a;<br />
		a=f;<br />
		System.out.println(a.area());</p>
<p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-that-illustrates-how-run-time-polymorphism-is-achieved/">Java program that illustrates how run time polymorphism is achieved</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<pre lang="java" escaped="true" line="1">
class figure
{
	double d1,d2;
	figure(double a,double b)
	{
		d1=a;
		d2=b;
	}
	double area()
	{
		System.out.println("Area of the figure");
		return 0;
	}
}
class rectangle extends figure
{
	rectangle(double a,double b)
	{
		super(a,b);
	}
	double area()
	{
		System.out.println("Area of rectangle");
		return d1*d2;
	}
}
class triangle extends figure
{
	triangle(double a,double b)
	{
		super(a,b);	
	}
	double area()
	{
		System.out.println("Area of triangle");
		return d1*d2/2;
	}
}
class runpoly
{
	public static void main(String[] args)
	{
		figure f=new figure(45,6);
		rectangle r=new rectangle(10,30);
		triangle t=new triangle(10,20);
		figure a;
		a=f;
		System.out.println(a.area());
		a=r;
		System.out.println(a.area());
		a=t;
		System.out.println(a.area());
	}
}
</pre>
<p><strong>Output:</strong><br />
Area of figure<br />
0.0<br />
Area of rectangle<br />
300.0<br />
Area of triangle<br />
100.0</p><p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-that-illustrates-how-run-time-polymorphism-is-achieved/">Java program that illustrates how run time polymorphism is achieved</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-that-illustrates-how-run-time-polymorphism-is-achieved/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
