Recent Posts
None | 8 sec ago
None | 31 sec ago
None | 42 sec ago
None | 55 sec ago
None | 57 sec ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
None | 2 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By Anonymous on the 2nd of Apr 2009 06:07:33 AM
Download |
Raw |
Embed |
Report
import java.io.*;
class MetodoYConstructor
{
private int a;
private int b;
private double r;
public MetodoYConstructor(int a, int b)
{
this.a=a;
this.b=b;
}
public MetodoYConstructor(double r)
{
this.r=r;
}
int arearectangulo()
{
return(a*b);
}
void areacirculo()
{
double area;
System.
out.
println("El area del circulo es "+area
);
}
}
class Aplicacion
{
{
int a,b;
double r;
System.
out.
println("introduce la base del rectangulo");
System.
out.
println("Introduce la altura del rectangulo");
System.
out.
println("ahora introduce el radio de un circulo");
r
=Double.
parseDouble(in.
readLine());
MetodoYConstructor obj1=new MetodoYConstructor(a,b);
MetodoYConstructor obj2=new MetodoYConstructor(r);
System.
out.
println("El area del rectangulo es "+obj1.
arearectangulo());
obj2.areacirculo();
}
}
Submit a correction or amendment below.
Make A New Post