About Question enthuware.ocpjp.ii.v11.2.3373 :

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

Moderator: admin

Post Reply
nurlan.tembayev
Posts: 1
Joined: Fri May 29, 2020 5:42 pm
Contact:

About Question enthuware.ocpjp.ii.v11.2.3373 :

Post by nurlan.tembayev »

first answer @SuppressWarning("rawtypes") marked as correct. But, JDK 11 does not contain this interface. May be it is mistyped and should be @SuppressWarnings("rawtypes")

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

Re: About Question enthuware.ocpjp.ii.v11.2.3373 :

Post by admin »

Yes, it should be SuppressWarnings. Fixed.
thank you for your feedback!
If you like our products and services, please help us by posting your review here.

noeloo
Posts: 61
Joined: Sat Feb 15, 2020 8:56 am
Contact:

Re: About Question enthuware.ocpjp.ii.v11.2.3373 :

Post by noeloo »

Are @SuppressWarnings("rawtypes") and @SuppressWarnings({"deprecation", "unchecked"}) indeed annotations?
For me it looks rather like they are proper calls to annotation (?), something like that, and annotation is @SuppressWarnings itself.

In the answer, why would stringLists[0].get(0) throw exception? Shouldn't it be array[0].get(0)?

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

Re: About Question enthuware.ocpjp.ii.v11.2.3373 :

Post by admin »

noeloo wrote:
Sat Jan 23, 2021 9:35 am
Are @SuppressWarnings("rawtypes") and @SuppressWarnings({"deprecation", "unchecked"}) indeed annotations?
For me it looks rather like they are proper calls to annotation (?), something like that, and annotation is @SuppressWarnings itself.
Well, if you want to be that precise then @SuppressWarnings is not an annotation either. SuppressWarnings is. But from the context of the question, I think the meaning is quite clear.
In the answer, why would stringLists[0].get(0) throw exception? Shouldn't it be array[0].get(0)?
What happened when you tried to compile and run the given code? Did you check the comments given in the code?
The point is that a List that was supposed to contain Strings now contains an Integer.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 45 guests