About Question enthuware.ocpjp.v11.2.1820 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
yuir12
Posts: 22
Joined: Thu Dec 09, 2021 11:23 pm
Contact:

About Question enthuware.ocpjp.v11.2.1820 :

Post by yuir12 »

Hello, Question. should it be List<Integer> newList vs List newLlist. Will it not require Object type? Thanks.

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests