6. Make a class called MyCircle, which models a circle.The class contains:
• One private instance variables: radius (int).
• A constructor that constructs a circle with the given radius.
• Write getter to get radius of the circle.
• Write setter to set the radius of the circle.
• A getArea() method that returns the area of the circle in float.
• A getCircumference() method that returns the circumference of the circle.
• Area of Circle = pr2
Circumference of Circle= 2pr
Create main class that construct two circles, assign radius to both circles and display their respective area and circumference.
Programming language : Java
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here