1. interface DoMath { double getArea(int rad); } interface MathPlus { double getVol(int b, int h); } / Missing Statements ? / which two code fragments inserted at end of the program, will allow to compile? class AllMath extends DoMath { double getArea(int r); } interface AllMath implements MathPlus { double getVol(int x, int y); } interface AllMath extends DoMath { float getAvg(int h, int l); } class AllMath implements MathPlus { double getArea(int rad); } abstract class AllMath implements DoMath, MathPlus { public double getArea(int rad) { return rad rad 3.14; } }
Ask Your Doubts Here
Comments
By: guest on 02 Jun 2017 01.25 am
(3) are (5) are correct because interfaces and abstract classes do not need to fully implement the interfaces they extend or implement (respectively). (1) is incorrect because a class cannot extend an interface. (2) is incorrect because an interface cannot implement anything. (4) is incorrect because the method being implemented is from the wrong interface.