Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

class circle

  Asked By: Dukker    Date: Jun 22    Category: Java    Views: 684
  

class circle
{
private int xposition
private int y position
private int radius
private Static final double PI=3.142

private circle Mycircle;
{
this.x=xposition
this.y=yposition
this.r=radius
}

public double calculateArea()
{
return PI*r*r;
}

public double calculateCircumference()
{
return 2*PI*r;
}

public double calculateRadius()
{
return r
)

private void paint(Graphics g)
{
g.setColor(Color.red);
g.fillOval(xposition, yposition, 75, 210);
g.drawString(xposition + 75, 210);
g.drawOval;
}

System.out.print("The radius is " + return radius);
System.out.print("The area is " + return area);
System.out.print("The circumference is " + return circumference);
}
}
}

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on class circle Or get search suggestion and latest updates.




Tagged: