Given:
1. public class Hose <E extends Hose> { 2. E innerE; 3. public static E doShape(E e, Hose<E> e2) { 4. // insert code here 5. } 6. public E getE() { 7. return innerE; 8. } }
Which can be inserted, independently at line 4, for the code to compile? (Choose all that apply.)
getE()
;getE()
;Hose()
.getE()
;F is correct.
The generic type "E", which is declared at the class level, will be associated with each instance of Hose, and is not accessible to static methods.
If doShape()
was non-static, A and D would be correct.