About Question enthuware.ocpjp.ii.v11.2.3373 :
Moderators: Site Manager, fjwalraven
-
- Posts: 1
- Joined: Fri May 29, 2020 5:42 pm
- Contact:
About Question enthuware.ocpjp.ii.v11.2.3373 :
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")
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.3373 :
Yes, it should be SuppressWarnings. Fixed.
thank you for your feedback!
thank you for your feedback!
Re: About Question enthuware.ocpjp.ii.v11.2.3373 :
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)?
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)?
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.3373 :
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.
What happened when you tried to compile and run the given code? Did you check the comments given in the code?In the answer, why would stringLists[0].get(0) throw exception? Shouldn't it be array[0].get(0)?
The point is that a List that was supposed to contain Strings now contains an Integer.
Who is online
Users browsing this forum: No registered users and 4 guests