Create a Java program which should contain Circle as a Base Class in which you have to make two private fields radius and color. Methods and Constructors should also be defined which is mentioned in the Class diagram. Moreover, you must make another class called Cylinder which should be inherited from Base Class Circle and it should contain only height as a private field.
Following Diagram should be considered for creating program
can anyone do th coding of this question?
Answers
Answered by
0
public class circle
{
private int radius,color;
circle()
{
radius=0;
color=0;
}
public static void main(String[] args)
{
circle o=new circle();
}
}
class cylinder extends circle
{
private int height;
cylinder()
{
super();
height=0;
}
}
Similar questions