Cylinder cy = new Cylinder(1, 1); Circle c = cy;

Analyze the following code:
Cylinder cy = new Cylinder(1, 1);
Circle c = cy;


A. The code has a compile error.
B. The code has a runtime error.
C. The code is fine.

The correct answer is C


Java

Learn More Multiple Choice Question :