Consider the following program:
class Base<T> { } class Derived<T> { } class Test { public static void main(String []args) { //Stmt#1 } }
Which statements can be placed in the place of //Stmt#1
and the program remains compilable
(select all that apply)?
a) d) f)
When <? extends Number> is specified as a type, then you can use any type derived from Number (including Number); hence, options a) and d) are correct.
Option f) is correct since class names are the same in both the sides, and ? in <?> is replaced by Integer, which is allowed.