Page 1 of 1

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

Posted: Fri May 29, 2020 5:48 pm
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")

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

Posted: Fri May 29, 2020 10:22 pm
by admin
Yes, it should be SuppressWarnings. Fixed.
thank you for your feedback!

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

Posted: Sat Jan 23, 2021 9:35 am
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)?

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

Posted: Sat Jan 23, 2021 10:33 am
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.