Tuesday, May 28, 2019

Week3 Android Circle

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.*;

public class Circle {
    double radius;

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    public Circle(double radius){
        this.radius = radius;
    }

    public double getArea(){
        return Math.PI * radius * radius;
    }

    public double getCircumference(){
        return 2 * Math.PI * radius;
    }

}

1 comment:

  1. I am really impressed with your blog article, such great & useful knowledge you mentioned here.Your post is very informative. I have read all your posts and all are very informative. Thanks for sharing and keep it up like this.
    SEO Company In Pune

    ReplyDelete

Note: Only a member of this blog may post a comment.