please write in java
Write a Java class named circle which contains:
Instance variables: Radius of type double. Color of type String.
Overloaded constructors: Default constructor "no argument".
Constrictor which takes two arguments (a double argument for
radius, a string argument for color). a public method getArea()
which return the area of the circle based on the radius. note:
Variables should be private, the constructor should be public.
The output should be:
circle: radius=2.0
the area =12.566370614359172
color = red
circle: radius=1.0
the area =3.141592653589793
please i really need to the correct solve.
color = black
please write in java Write a Java class named circle which contains: Instance variables: Radius of type double. Color of
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am