Page 1 of 1

About Question enthuware.ocpjp.i.v11.2.3086 :

Posted: Thu Aug 22, 2019 11:55 am
by Artuwok
Hi! I don't get this part
events.forEach( (k, v)->processEvents(v));
The lambda expression being passed to forEach is syntactically correct. However, the type of v is Object and there is no processEvents method available that can accept an Object.

Why v is Object?

Re: About Question enthuware.ocpjp.i.v11.2.3086 :

Posted: Thu Aug 22, 2019 9:16 pm
by admin
Type of v is Object because the type of "events" is non-generic Map (i.e. without any generic type applied to it) and therefore Map's key and value are Object and Object respectively.