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

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

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: 10384
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!

Deleted User 6318

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

Post by Deleted User 6318 »

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: 10384
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.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 10 guests