1. Yes. The phone class implements correctly the Device interface. 2. No. The class attribute Device is not a superclass of the class Phone. 3. No. The attribute class and type cannot be used together. 4. Yes. The useBean Tag is implemented correctly. 5. No. An InstantiationException is thrown at compile-time.
The answer given is 2.But for me i think the answer 5 is also correct , because we cannot create an instance of an interface.
If the class attribute is used for a Java type that cannot be instantiated as a JavaBean, the container may consider the page invalid, and is recommended to (but not required to) produce a fatal translation error at translation time, or a java.lang.InstantiationException at request time.
With Tomcat 5.x, a translation error occurs. But who what happens with another container...