Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q2 Interfaces16 PointsGrading comment: For each of the following, tell if the code will compile. If so, no explanation is needed. If not, explain why.
Q2 Interfaces16 PointsGrading comment:
For each of the following, tell if the code will compile. If so, no explanation is needed. If not, explain why.
Syntax errors, if any, are inadvertent and should be ignored. Also, code outside of an explicit class is considered to be in the main method of some arbitrary class in the same package.
Q2.13 PointsGrading comment:
public interface I { void imethod(T t); } public class SomeI implements I { public void imethod(SomeI sm) { } }
Q2.23 PointsGrading comment:
public interface H { void hm(); } public class HI implements H { public void hm() { } } H hobj = new H();
Q2.34 PointsGrading comment:
public interface A { void astuff(E e); } public interface B { void bstuff(E e); } public class AB implements A, B { ... // assume astuff/bstuff implemented } A intf = new AB(); intf.bstuff(new AB());
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started