Adding annotations to lambda parameters

You can use annotations with lambda parameters if you define them with either explicit data types or by using the reserved type var. Annotations could be used to mark null or non-null lambda parameters. Here's an example:

(@Nullable var x, @Nonnull Integer y) -> x + y;

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.27.131