Question: write a java program as shown in the below class class diagram then write the next main method and make your most. extends public static

 write a java program as shown in the below class class
write a java program as shown in the below class class diagram then write the next main method and make your most.
diagram then write the next main method and make your most. extends
public static void main (String args [1) f Shape s1 - new

extends public static void main (String args [1) f Shape s1 - new Circle(5.5, "red", false); // Upeast System.out.println (s1); System.out.printin (s1.getArea ()); System.out.print1n (s1. getPerimeter ()): System. out.printin(s1.getcolor ()) ; System.out.println (s1. isFilled ()): System.out. println (s1. getRadius ())): Circle c1 = (Circle)sl: // Downcast system.out.println (cl); System, out.print1n (cl.getArea ()) ; system.out.printin (cl.getperimeter ()); System, out.printin (cl.getcolor()): system. out.println(c1.iseilled ()) ; system, out.printin (cl, getRadius ()) : Shape s2 = new Shape( ; Shape s3 = new Rectangle (1.0,2.0, "red", false ); System.out.println (s3): System.out.println (s3.getArea ()); System,out.print1n (s3.getperimeter ()); System.out.printin (s3.getcolor ()); system. out. printin (s3. get.Length ()); Rectangle x1= (Rectang1e) 33 ; System, out. printin(x1); Syatem. out. println ( x1. getArea ()); System.out.println (r1. getColor()); System, out. println (r1. getLength ()); Shape s4 = new square (6,6); System,out.println (s4); System.out.println (s4.getArea ()); System, ouc.println (s4.getcolor ()): System, out. println (s4. getside ()); Rectangle r2= (Rectangle 34; System, out. println (x2); System, out.println ( 2 , getArea 0) ); System, out. printin (r2. getColor ()): System.out.println (r2.getside ()); system,out.print1n (r2. getLength ( ) ); Square sq1 = (Square) x2; system. out. printin (sq1); System. out.println (sq1. getArea ()): System. out. print1n (sq1. getColor ()): System. out.print1n (sq1.getSide ()); System.out. println (sq1. gettength ()) ; \}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!