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
Posts: 22
Joined: Thu Dec 09, 2021 11:23 pm

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.

Site Admin
Posts: 9804
Joined: Fri Sep 10, 2010 9:26 pm

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.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 4 guests