Page 1 of 1

About Question enthuware.ocpjp.v11.2.1820 :

Posted: Wed Jan 11, 2023 1:28 am
by yuir12
Hello, Question. should it be List<Integer> newList vs List newLlist. Will it not require Object type? Thanks.

Re: About Question enthuware.ocpjp.v11.2.1820 :

Posted: Wed Jan 11, 2023 2:14 am
by admin
No, not necessary. You can always assign a parameterized type to a non-parameterized type. i.e. List<Integer> can be assigned to List. There will be a warning but it is allowed.
You can try compiling and running the given code and see what happens.