Which two code fragments inserted at the end of the program will allow it to compile?
interface Shape {
double getArea(int rad);
}
interface Volume {
double getVolume(int b, int h);
}
/* Missing Statements ? *
1. class Geometry extends Shape { public double getArea(int r) { return Math.PI * r * r; } }
2. interface Geometry implements Volume { double getVolume(int x, int y); }
3. interface Geometry extends Shape { double getPerimeter(int length, int width); }
4. class Geometry implements Volume { public double getArea(int rad) { return rad * rad; } }
5. abstract class Geometry implements Shape, Volume { public double getArea(int rad) { return rad * rad; } }
Choose the correct answer from the options given below:
1
1 and 3
2
2 and 4
3
3 and 5
4
1 and 5
5
Question Not Attempted