Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package zad1;
- public class Circle {
- private int r = 0;
- private String color = "";
- static private int count = 0;
- Circle(){
- this.r = 0;
- this.color = "";
- count++;
- }
- Circle(int radius){
- this.r = radius;
- this.color = "Trans-parent";
- count++;
- }
- Circle(int radius, String setColor){
- this.r = radius;
- this.color = setColor;
- count++;
- }
- void setRadius(int setRadius) {
- this.r = setRadius;
- }
- int getRadius() {
- return this.r;
- }
- void setColor(String setColor) {
- this.color = setColor;
- }
- String getColor() {
- return this.color;
- }
- double getArea() {
- double Area = Math.PI*(Math.pow(r, 2));
- return Area;
- }
- int getCount() {
- return count;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement