Page 1 of 1

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

Posted: Tue Nov 26, 2019 5:43 pm
by girishankaran
Compiler is not accepting var in (var a, var b)

ls.sort((var a, var b) -> a.compareTo(b));
It is working without var

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

Posted: Tue Nov 26, 2019 9:56 pm
by admin
It compiles fine. Check your Java version.

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

Posted: Mon Dec 16, 2024 10:48 pm
by raphaelzintec
yes i agree i learned var cannot be method param type but didnt know lambda accept